Skip to content
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

Merged
merged 3 commits into from
May 21, 2024

Conversation

ilmedova
Copy link
Contributor

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

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

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 20, 2024
Copy link

netlify bot commented May 20, 2024

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 52821c7
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/664b98963706430008700795
😎 Deploy Preview https://deploy-preview-10151--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented May 20, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 64 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 59 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 76 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 71 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 69 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 69 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 76 🟢 100 🟢 100 🟢 90 🟠 88 Report

@OzakIOne OzakIOne added the pr: new feature This PR adds a new API or behavior. label May 20, 2024
Copy link
Collaborator

@slorber slorber left a 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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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",
Copy link
Collaborator

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

https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html#:~:text=Turkmen,tk

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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)

Copy link
Contributor Author

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

Copy link
Collaborator

@slorber slorber left a 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:

CleanShot 2024-05-20 at 19 41 37@2x

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 🤪

@ilmedova
Copy link
Contributor Author

Got it, I will update it soon

@ilmedova
Copy link
Contributor Author

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 ❤️ 🙏
I got it now and updated the all the plurals. Thank you for your time reviewing!

@slorber
Copy link
Collaborator

slorber commented May 21, 2024

thanks 🙏

@slorber slorber merged commit b6644d8 into facebook:main May 21, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants