calendar icon indicating copy to clipboard operation
calendar copied to clipboard

l10n: There is no text string in Transifex

Open Valdnet opened this issue 4 years ago • 4 comments

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?

Valdnet avatar Aug 31 '21 09:08 Valdnet

I think we already had the issue once.

tcitworld avatar Sep 01 '21 17:09 tcitworld

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

rakekniven avatar Dec 01 '21 20:12 rakekniven

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.

st3iny avatar Dec 01 '21 21:12 st3iny

Thank you for digging into it. Explanation is clear.

Unfortunately I have no good idea for another wording.

rakekniven avatar Dec 02 '21 08:12 rakekniven

Another issue referencing to this one.

https://github.com/nextcloud/server/issues/48840

rakekniven avatar Dec 10 '24 14:12 rakekniven

@st3iny Who can tackle this one again?

rakekniven avatar Dec 10 '24 14:12 rakekniven

@rakekniven we are probably going to need another class for positions "this.$t('calendar-poistion', 'second')"

Let me check in to this.

SebastianKrupinski avatar Dec 10 '24 17:12 SebastianKrupinski

Two more users reported this at our forums.

@SebastianKrupinski Did you had a chance to have a look at it?

rakekniven avatar Dec 19 '24 14:12 rakekniven

@rakekniven I have not seen the other tickets, can you link them here, if you have them on hand.

SebastianKrupinski avatar Dec 19 '24 14:12 SebastianKrupinski

I meant have you had time to look at the problem here?

I mentioned the other postings to show that other users are looking at the issue. Postings have no relevant news.

Just checked my installation v30.0.4 and issue is still there: Image

rakekniven avatar Dec 19 '24 16:12 rakekniven

I implemented a whacky solution at #6752.

st3iny avatar Feb 20 '25 21:02 st3iny

Hey Richard @st3iny ,

you are quick. PR has been already merged. Thank you for taking care of that.

Do I understand correctly that you have changed the plural function to pure plural?

But I was just wondering when the first time a translator will ask for the plural again 🤷

rakekniven avatar Feb 20 '25 22:02 rakekniven

Do I understand correctly that you have changed the plural function to pure plural?

Yes, the plural is now always used in the reminder select. Now, two distinct strings are registered which should be translatable independently of each other, i.e., second and seconds.

st3iny avatar Feb 20 '25 22:02 st3iny

Hmm, I just realized that we will need to add context now. The first term second refers to the second event in a series but the second term seconds refers to a time unit. That could confuse translators.

st3iny avatar Feb 20 '25 22:02 st3iny