nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
989 stars 240 forks source link

l10n: There is no text string in Transifex #3441

Open Valdnet opened 3 years ago

Valdnet commented 3 years ago

The following text string is missing from Transifex:

https://github.com/nextcloud/calendar/blob/9697327072cef227f1c414c0764b287402ef66a7/src/components/Editor/Repeat/RepeatFirstLastSelect.vue#L65

https://github.com/nextcloud/calendar/blob/2d5f39bed56c217ba1421b91323ca5860a6e5ee2/src/filters/recurrenceRuleFormat.js#L208

obraz

This is because a similar text string is found in this:

https://github.com/nextcloud/calendar/blob/ecac7cc447b868d5c3d7b668acc8d7cf139b3513/src/components/Editor/Alarm/AlarmTimeUnitSelect.vue#L74

obraz

which is in the plural.

@ChristophWurst Do you have any idea for that?

tcitworld commented 3 years ago

I think we already had the issue once.

rakekniven commented 3 years ago

Still the same for v3.0.1 on NC v22.2.3 Browser: Firefox v94 OS: macOS Big Sur 11.6.1

st3iny commented 3 years ago

So I dove into gettext and found the root of this problem. Every msgid inside a PO file has to be unique. In calendar there is an ambiguity between "second" singular and "second/seconds" plural. Both instances are assigned to the same msgid "second" which is not allowed.

However, more modern versions of gettext are able to handle message contexts but neither our javascript library (@nextcloud/l10n) not our extraction tool (translationtool.phar) are able to handle those at the moment.

Ref http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html -> scroll to 2.2.2. Disambiguating Contexts

The only quick fix I can come up with right now is to change the wording. See also the warning message that translationtool.phar emits:

xgettext: Warnung: msgid 'second' is used without plural and with plural.
                   /srv/http/dev_apps/calendar/coverage/src/components/Editor/Repeat/RepeatFirstLastSelect.vue.html:324: Here is the occurrence without plural.
                   /srv/http/dev_apps/calendar/translationfiles/templates/calendar.pot:645: Here is the occurrence with plural.
                   Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation.
rakekniven commented 3 years ago

Thank you for digging into it. Explanation is clear.

Unfortunately I have no good idea for another wording.