-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(theme-translations): Added Turkmen (tk) default theme translations #10151
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks
Just found the plural forms look wrong + another spacing case
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": "Taryh ýazgysyny aýyrmak", | ||
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": "Gözleg soragyny ýatda saklaň", | ||
"theme.SearchPage.algoliaLabel": "Algolia tarapyndan gözleg", | ||
"theme.SearchPage.documentsFound.plurals": "{count} dokument|{count} dokumentler|{count} dokumentler", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 forms instead of 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2, but Turkmen has six cases: nominative, (specifically definite) accusative, dative, genitive, instrumental/ablative and locative. And all the plurals are formed from -lar/ler, but it is not used when the quantity is explicit, but also plurals can also change according to these six cases. There will be one exceptional situation for accusative case that changes plural form, which makes it up to 3 forms in total.
I know why they didn't provide this information on the website link you provided, the reason for this is that in there they provided information only for the countable numbers and not the suffixes of the noun which is followed by that certain number.
And you can also mention that in the translations I provided not in all the accusative forms it changes the form, sometimes it stays the same (if compared to English, plurals in Turkmen are like 3 forms of past tenses in English, for some it changes, but for some it does not. For example: (cut, cut, cut) - does not change, (worked, worked, worked) - does not change, (write, wrote, written) - changes). That is the reason why I made it 3 forms. Because for some nouns and cases it changes the form and for some it does not.
Should I redo that according to only those situations that exactly changes the plural? Because currently they have their third form regardless if it changes or not.
"theme.docs.sidebar.navAriaLabel": "Dokumentleriň gapdal paneli", | ||
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": "Navigasiýa panelini üýtgetmek", | ||
"theme.docs.tagDocListPageTitle": "\"{tagName}\" bilen {nDocsTagged} dokumentler", | ||
"theme.docs.tagDocListPageTitle.nDocsTagged": "1-nji sahypa|{count}-nji(y) sahypa|{count}-nji(y) sahypa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 forms instead of 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here plural form doesn't change itself, but as grammatically plural changes according to cases I thought it would be correct to put the 3rd form regardless of its change
"theme.common.editThisPage": "Bu sahypany üýtgetmek", | ||
"theme.common.headingLinkTitle": "{heading} sahypa göni geçiň", | ||
"theme.common.skipToMainContent": "Esasy mazmuna geç", | ||
"theme.docs.DocCard.categoryDescription.plurals": "{count} element|{count} elementler|{count} elementler", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 forms instead of 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here also plural form doesn't change itself, but as grammatically plural changes according to cases I thought it would be correct to put the 3rd form regardless of its change
"theme.blog.post.plurals": "{count} ýazgy|{count} ýazgylar|{count} ýazgylary", | ||
"theme.blog.post.readMore": "Dowamyny okamak", | ||
"theme.blog.post.readMoreLabel": "{title} hakda doly okamak", | ||
"theme.blog.post.readingTime.plurals": "{readingTime} min okamak|{readingTime} min okamak|{readingTime} min okamak", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 forms instead of 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here plural form doesn't change itself, but as grammatically plural changes according to cases I thought it would be correct to put the 3rd form regardless of its change
"theme.blog.post.paginator.navAriaLabel": "Blog ýazgysynyň sahypasyndaky nawigasiýa", | ||
"theme.blog.post.paginator.newerPost": "Täze ýazgy", | ||
"theme.blog.post.paginator.olderPost": "Köne ýazgy", | ||
"theme.blog.post.plurals": "{count} ýazgy|{count} ýazgylar|{count} ýazgylary", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLDR says Turkmen only has 2 cardinal forms
My browser also says so:
function getLocalePluralForms(locale) {
const AllPluralForms = ['zero','one','two','few','many','other']
const pluralCategories = new Intl.PluralRules(locale).resolvedOptions().pluralCategories;
pluralCategories.sort((c1,c2) => AllPluralForms.indexOf(c1) > AllPluralForms.indexOf(c2) ? 1 : -1);
return pluralCategories;
}
const myLocale = "tr"; // Change this variable!
console.log("Plural forms for this locale are =>>> ",getLocalePluralForms(myLocale));
So, why are you using 3 plural forms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as you can mention plural changes its form. So 3rd form is important in this particular case.
Regarding the code snippet you provided, I have executed it before I made PR, but as I mentioned before, the plural form changes itself according to the accusative form of speech (in formal written Turkmen language, it is crucially important). That is the reason why I made it to 3 forms everywhere in the translations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know Turkmen, but the problem is that if you provide 3 forms, the 3rd one will never ever be used by our translation system, so it's better to provide 2.
I don't think our system atm is able to handle "accusative form of speech" so please only consider the 2 CLDR "one"+"other" plural forms. It seems to be a particularity of your language that the JS Intl API is maybe not designed to solve. It is unlikely we will be able to support this in Docusaurus unless JS add support for it first 😅 .
I can't advise more what you should do exactly, but please only keep 2 plural forms. Otherwise I'll merge by just removing the last one (because it won't be used anyway so it won't change anything in terms of outcomes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ok, I got it, I will update it soon
packages/docusaurus-theme-translations/locales/tk/theme-common.json
Outdated
Show resolved
Hide resolved
….json Co-authored-by: Sébastien Lorber <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help you understand how it woirks and why we only support 2 plural forms.
Your 3-form string gets splitter into:
one
:{count} ýazgy
other
:{count} ýazgylar
- ignored:
{count} ýazgylary
Then we run this JS Intl standard API with the number of items as parameter to get the correct plural form to render:
Because Turkmen only has 2 plural forms according to CLDR data and JS standard APIs, we will only be able to select one of the first 2 messages, and the 3rd one will never be displayed anywhere. That's why you should remove it.
Now I'm not an expert in languages, and we don't plan to change this system. If you feel JS could support better the subtleties of Turkmen, then you should tell them directly 🤪
Got it, I will update it soon |
I think I didn't understand it completely on the first try. Sorry for inconvenience and your time making it clear for me. Appreciate it ❤️ 🙏 |
thanks 🙏 |
Pre-flight checklist
Motivation
Added Turkmen (tk) language translations to the default theme
Test Plan
Test links
Deploy preview: https://feat-tk-turkmen--docusaurus-tk.netlify.app/
Related issues/PRs