[openstreetmap/openstreetmap-website] Translation strings should be refactored to avoid "sentence building" (Issue #3740)
bgo-eiu
notifications at github.com
Fri Oct 7 04:22:05 UTC 2022
This is intended to be a broader issue to address the problems which come from the current localization system assembling sentences from translated fragments. This was brought up in #3731 as it pertains to the `to_sentence` function in the map key. Since @gravitystorm pointed out that it seems better to just translate whole strings and I am inclined to agree, I will list some more examples where this is an issue. Besides the two other places `to_sentence` occurs, there are a number of places in the translatewiki messages where a substitution is occuring or a sentence fragment is used in a way that forces awkward translations (or incorrect ones, based on what I've seen looking at the strings in other localizations.)
### Word substitutions
An example message: "%{type} %{name} not found" (type being node, comment, note, etc. name being ID)
Problem this causes: In languages which have grammatical gender, a grammatical sentence cannot be constructed in this way. To say "Note 1234 not found," in Punjabi we may say:
نوٹ نمبر 123 نہیں لبھیا
"not nahi~ labhiaa"
To say "Comment 1234 not found,":
ٹپݨی نمبر 1234 نہیں لبھی
"tipani nahi~ labhi"
We have to change the form of the verb labh-, to find, to match the gender, because note is masculine and comment is feminine. In order to make this work, I ended up putting the whole "not found" phrase as the translation for the type itself. This is not ideal though, as it means I have to say what the ID of the object is separately which looks awkward.
### Appending and prepending outside of the message
An example message: "in" (context: [trace XYZ] uploaded by "username" in "category")
Problem this causes: In languages which use postpositions rather than prepositions, a direct translation results in a sentence with the meaning [trace XYZ] uploaded by "category" in "username." Based on looking at the existing localizations, this flipped meaning is already ahowing for some of them as they were translated directly without checking the context. This was my solution:
اے۔ ایہہ ٹیگ
"ae. ih taeg"
Really the category/tag is supposed to be at the beginning of the sentence to be grammatical, but this is not an option. So what my solution does is it adds a word and full stop to make the first part an independent sentence that would roughly translate to "this upload exists." Then, it starts a whole new sentence where the category/tag can be inserted in a place where it fits.
These are the examples that first came to mind, I will add others if I think of any. There may be related issues others have noticed
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3740
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3740 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221006/9a3cf3ef/attachment.htm>
More information about the rails-dev
mailing list