fmtm
fmtm copied to clipboard
Localisation with UI translations in as many languages as possible
Help us to translate Field-TM!
- We need transaltions in as many languages as possible to make FMTM more accessible!
- Your contribution and validation of translations is extremely useful to mappers in the field, that speak a wide variety of languages.
How to contribute
Visit https://hosted.weblate.org/engage/hotosm to see our Weblate translations.
There you can update the translation string that go into:
- The mapping interface for users in the field.
- The survey question translations that go into the web form or ODK Collect in the field.
Another option to contribute is via Fink.
See https://docs.fmtm.dev/decisions/0005-translations for information about the tools we use.
A small note about translations and sentence structure (for developers)
Injecting variables
-
This is possible by using placeholders in the text such as
{myValue}:code
{m['popup.task_complete_total_mapped']({ totalMapped: `${taskSubmission?.submission_count}/${taskSubmission?.feature_count}`, })}en.json
"task_complete_total_mapped": "You have mapped {totalMapped} features in the task area.",
Sentence variations
- It may be tempting to inject variables to facilitate sentence variations, such as 'You have mapped...' vs 'You have only mapped...'
- In theory you could also make translations that are composed of multiple translated parts, to avoid duplication.
- However these may result in issues rooted in linguistics.
- Sentence structure can vary significantly from language to language, meaning sometimes a sentence only makes sense in it's full context and written order.
- When in doubt: it's probably best to write an entirely new translation key / string.
https://github.com/hotosm/fmtm/pull/2425#issuecomment-2835635064
Having styling within the translation
- This one wasn't easy!
- Paraglide (and most libs) can't support formatting included for part of the translation string.
- One option is to cut up the string into parts, but you get problems like I mentioned above around natural sentence structuring, as mentioned above.
- The easiest solution I found for now was to hardcode unicode bold text inside the translation!
- I made a util function that converts standard strings to bold strings, using unicode, available in
src/utils/text.ts. - We could write similar functions for other styling types, such as italics.
The Weblate link you mentioned above seems to be broken. Can you verify or may be i missed something?
The Weblate link you mentioned above seems to be broken. Can you verify or may be i missed something?
They deleted the org because it wasn't used.
We need to apply for an open source licence again
Okay, Please keep us updated if any progress. This can be good issue where we can expect community support and we can add this on presentations for interested volunteers.
I have done an analysis of available options: https://docs.fmtm.dev/decisions/0005-translations/
I will look at integrating paraglide into the mapper frontend for a start 👍
One key consideration is: do we care about translating URL routes too?
For example: https://fmtm.hotosm.org/projects/1 https://fmtm.hotosm.org/proyectos/1 https://fmtm.hotosm.org/projets/1 https://fmtm.hotosm.org/परियोजनाहरू/1
I have a feeling it's more hassle than it's worth, but keen to hear opinions on this @manjitapandey @ramyaragupathy
We will prioritise the UI translations anyway, but it's good to keep in mind as it affects how we integrate Paraglide 👍
I personally don't think its good to add translations on url. It complicates things more and moreover, the URL are considered good if consistent irrespective of language.
fwiw, I agree with @manjitapandey
Hi @spwoodcock , I may need help on how to use fink for translation to different language. I encountered an error as below. Do you mind sharing the video or any notes that may help?
.
There's no project.inlang folder in this repository, that's required by inlang/Fink:
"The i18n editor, requires a project.inlang folder in your repository."
See this project for example:
- https://fink.inlang.com/github.com/hiddify/hiddify-app
- https://github.com/hiddify/hiddify-app/tree/main/project.inlang
https://github.com/hotosm/fmtm/tree/development/src%2Fmapper%2Fproject.inlang
Perhaps it needs config in place to point to the nested dir?
Maybe translation should be for the whole project, not only for the mapper front-end.
Perhaps yeah, but its only in place for the frontends, not related to backend.
I thought it made sense to separate translations for manager and mapper frontends as the translation keys are different and they can be translated in Fink independently.
But saying that, some translations for key fields (such a login / logout / back / submit / etc) can be shared.
We can consider this again when looking into how this all ties together with integrating hotosm/ui and translations for that (across projects, saving translating the same fields multiple times).
For now, I would say we just keep it as it is if possible (we are prioritising the mapper frontend translations only for now).
I had this working previously with the nested inlang dir - perhaps it just needs pointing to in Fink?