-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing link from resource to translated community name? #616
Comments
If I’m not mistaken: osm-community-index/lib/resolve_strings.js Lines 36 to 39 in d31da8c
osm-community-index/lib/simplify.js Lines 3 to 5 in d31da8c
|
Right, got you. I really didn't expect the translation key to be derived from a string value like that! Thanks for the insight. |
Oh, I should have asked before I closed this - would you contemplate changing how these lookups work? Or is there a technical reason with the translation system for keeping it like this? I find that deriving the lookup key from a string is unexpected! Is there any reason not to have the translation lookup key explicitly within the resource? It also means that projects that are using the osm-community-index information in a different language (e.g. over on openstreetmap-website) need to reimplement (and maintain, and follow any upstream changes to) both the simplify function and also the diacritics module, to make sure that we are matching the process to convert the string into the key. Would another option be for this conversion to be done once and explicit keys used in the resource instead? |
At a glance, explicitly defining the lookup key would make sense to me, even if it would require a little more work to populate those keys. However, maybe @bhousel knows of other considerations. |
I guess most of the context is on #30 (comment) and the comments after that one. We had wanted for a while to use default strings and some method of putting strings together to make less work for our volunteer translators. So yeah, I'm ok with changing it so that we store the generated |
hey! I am up for picking this up, as I'd rather it was done in this project than re-implemented in the osm website's code. @bhousel can you give me any hints or tips on where in the code to add this, please? |
I think this will depend on how the maintainers want it to be implemented, and the main choice is whether the attribute should be generated in just the output files (i.e. I'd look at adding a osm-community-index/scripts/build_index.js Line 241 in 8ffdb28
Of course, the maintainers might have a better approach in mind! |
☝️ I did this.. |
@bhousel Thank you! |
Amazing, thank you @bhousel 🤩 |
I'm opening this here for additional visibility, and the original issue is open over on the openstreetmap-website repository at openstreetmap/openstreetmap-website#3814
I'm unable to figure out how to get the translated name for a resource, when the translation uses fallbacks based on the resource type.
For example, given the fr-chapter resource, I can look up the
fr-chapter
entry ini18n/pl.yml
.There is no
name:
there, so I then look up the translation defaults for the resource type in order to determine the fallback string - i.e.pl._defaults.osm-lc
. This givesFinally, and this is where I get stuck, I need to know which community to put in there. I mean, I personally know that it's supposed to be
pl._communities.openstreetmapfrance: OpenStreetMap Francja
. However, I can't find any link - either in the translations file or in any resources file - that has the mapping fromfr-chapter
->openstreetmapfrance
.Any guidance would be greatly appreciated!
The text was updated successfully, but these errors were encountered: