Skip to content

Update French (Canada) and Japanese translations - #431

Merged
OmarIthawi merged 1 commit into
appsembler/tahoe/developfrom
omar/update-i18n
Aug 7, 2019
Merged

Update French (Canada) and Japanese translations#431
OmarIthawi merged 1 commit into
appsembler/tahoe/developfrom
omar/update-i18n

Conversation

@OmarIthawi

@OmarIthawi OmarIthawi commented Aug 6, 2019

Copy link
Copy Markdown

I've done the following:

This is mainly to resolve a couple of PSAC reported issues.

"Chapter name is required": "Le nom du chapitre est requis",
"Chapter {order}": "Chap\u00eetre {order}",
"Check Your Email": "V\u00e9rifiez votre courriel",
"Check the box to remove %(count)s flag.": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarIthawi singular 'flag'?

@johnbaldwin

Copy link
Copy Markdown

@OmarIthawi I skimmed over one of the files and see what look like three cases:

"there is currently {numVotes} vote": [
	      "il y a actuellement {numVotes} vote", 
	      "il y a actuellement {numVotes} votes"
	    ], 

For the english expression, is that always singular?

@OmarIthawi

OmarIthawi commented Aug 6, 2019

Copy link
Copy Markdown
Author

Thanks @johnbaldwin.

@OmarIthawi I skimmed over one of the files and see what look like three cases:

"there is currently {numVotes} vote": [
	      "il y a actuellement {numVotes} vote", 
	      "il y a actuellement {numVotes} votes"
	    ], 

For the english expression, is that always singular?

So, not really. The file has been generated by a script.

Looking at the corresponding JavaScript-based functions:

django.pluralidx = function(n) {
var v=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;
if (typeof(v) == 'boolean') {
return v ? 1 : 0;
} else {
return v;
}
};

django.ngettext = function(singular, plural, count) {
var value = django.catalog[singular];
if (typeof(value) == 'undefined') {
return (count == 1) ? singular : plural;
} else {
return value[django.pluralidx(count)];
}
};

The English plural form exists in the source:

votesCountMsg = ngettext(
'there is currently {numVotes} vote', 'there are currently {numVotes} votes', numVotes
);

So it looks like, unlike the po files which preserves the original English plural form, the JavaScript file ignores it. Mostly a space-saving measure since the English plural form is useless in the Arabic context.

That's what I think, please let me know what do you think?

@OmarIthawi
OmarIthawi requested a review from johnbaldwin August 7, 2019 16:19

@johnbaldwin johnbaldwin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarIthawi Honestly, I would need to dig into the translations code to understand how it handles pluralization. I'll accept your explanation on English -> Arabic pluralization

@OmarIthawi

Copy link
Copy Markdown
Author

Thanks @johnbaldwin, it's literally just the two function above ☝️

Yes, there's a lot of more context and tooling around this to get to those functions, but that's what the user needs on their browsers to be able to see Arabic (and other languages) for the JavaScript strings.

@OmarIthawi
OmarIthawi merged commit dd20600 into appsembler/tahoe/develop Aug 7, 2019
@OmarIthawi
OmarIthawi deleted the omar/update-i18n branch November 21, 2019 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants