photoprism / photoprism

AI-Powered Photos App for the Decentralized Web 🌈💎✨
https://www.photoprism.app
Other
33.87k stars 1.86k forks source link

Translations: Extract translation strings with context #1152

Open ohjohnsen opened 3 years ago

ohjohnsen commented 3 years ago

When creating the Norwegian translation, I remember I was wondering if the word "archive" (which can be both noun and verb) should be translated to "arkiv" (singular noun) or "arkivér" (imperative verb). I chose "arkivér", and now see that the word has been used also as a noun, which becomes wrong in the Norwegian translation.

Screen shot from the side menu, where "archive" is a noun image

Screen shot from the selected image context menu, where "archive" is a verb image

Suggestion: That you keep the current text string in the context menu, and add a second text string for the noun to be used in the side menu.

ohjohnsen commented 3 years ago

I'm sorry, but I have to say I disagree with the premise that you need to "generate different translation strings for one english word". I believe the text strings in applications should be considered in the light of what actions they represent rather than what the text strings themselves say. In this case you have two actions: One is that you wish to archive a selection of photos and the other is that you wish to see the previously archived photos. For me it seems logical that this requires two different text strings (or entries in the translation files), even though they might be equal in some languages (ie. English) and different in others (ie. Norwegian).

StephenBrown2 commented 3 years ago

For me it seems logical that this requires two different text strings (or entries in the translation files), even though they might be equal in some languages (ie. English) and different in others (ie. Norwegian).

I concur.

graciousgrey commented 3 years ago

I believe the text strings in applications should be considered in the light of what actions they represent rather than what the text strings themselves say. In this case you have two actions: One is that you wish to archive a selection of photos and the other is that you wish to see the previously archived photos.

I am completely with you.

What happens technically at the moment is that gettext extracts all unique strings from the code to be translated. It happens that in the base language (english) the same word is used in different contexts but is only extracted once for translations. What we need to do is extract it once for each context and provide contextual information like screenshots. We plan to use weblate in combination with gettext soon. Weblate has an option to provide contextual screenshots, but still if a is word used in different context it needs to be extracted for each context and not only once.