-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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): default translations for Slovenian (sl-SI) #8541
Conversation
Hi @MatijaSi! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
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.
Thank you for the contribution. Could you take a look at https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-translations for instructions on how to create translations? Your generated JSON should look like https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-translations/locales/ar/plugin-ideal-image.json, without the description fields.
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.
Thanks, almost looks good.
I removed the useless __DESCRIPTION fields from your PR.
The plural forms are wrong, they should only contain 4 values instead of 5.
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 = "sl"; // Change this variable!
console.log("Plural forms for this locale are =>>> ",getLocalePluralForms(myLocale));
Plural forms for this locale are =>>> (4) ['one', 'two', 'few', 'other']
Unfortunately I don't speak sl and can't fix the existing forms 😅
You can get more info about plural forms here:
#3526
Also refer to this table:
https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html
Can't be sure but my intuition is that you should merge the 3rd and 4th plural forms because they all use the same suffix for 3 and 4 quantities: "{count} prispevki" / "{count} minute branja" / "{count} dokumenti imajo oznako" / "{count} dokumenti najdeni"
"theme.blog.post.plurals": "En prispevek|Dva prispevka|{count} prispevki|{count} prispevkov",
Please confirm and/or update your pr
"theme.blog.post.paginator.navAriaLabel": "Navigacija prispevka na blogu", | ||
"theme.blog.post.paginator.newerPost": "Novejši prispevek", | ||
"theme.blog.post.paginator.olderPost": "Starejši prispevek", | ||
"theme.blog.post.plurals": "En prispevek|Dva prispevka|Trije prispevki|Štirje prispevki|{count} prispevkov", |
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.
we should only have 4 plural forms
"theme.blog.post.plurals": "En prispevek|Dva prispevka|Trije prispevki|Štirje prispevki|{count} prispevkov", | ||
"theme.blog.post.readMore": "Preberite več", | ||
"theme.blog.post.readMoreLabel": "Preberite več o {title}", | ||
"theme.blog.post.readingTime.plurals": "Minuta branja|Minuti branja|Tri minute branja|Štiri minute branja|{readingTime} minut branja", |
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.
same
"theme.docs.sidebar.navAriaLabel": "Stranska vrstica dokumentacije", | ||
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": "Preklopi navigacijsko vrstico", | ||
"theme.docs.tagDocListPageTitle": "{nDocsTagged} ima oznako \"{tagName}\"", | ||
"theme.docs.tagDocListPageTitle.nDocsTagged": "En dokument ima oznako|Dva dokumenta imata oznako|Trije dokumenti imajo oznako|Štirje dokumenti imajo oznako|{count} dokumentov ima oznako", |
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.
same
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": "Umakni iskanje iz zgodovine", | ||
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": "Shrani to iskanje", | ||
"theme.SearchPage.algoliaLabel": "Iskanje Algolia", | ||
"theme.SearchPage.documentsFound.plurals": "Dokument najden|Dokumenta najdena|Trije dokumenti najdeni|Štirje dokumenti najdeni|{count} dokumentov najdenih", |
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.
same
Going to move on and apply my suggestion. Feel free to open another pr if I was wrong |
Slovenian has 4 plural forms, however until when we reach number 5 verb "imeti" refers to documents, while after (ex. "5 dokumentov ima") "imeti" verb doesn't refer anymore to "dokumentov", but to "5" (so it goes back to singular form). So we need to cover 5 distinct cases. |
@MatijaSi our pluralization system is based in the Intl apis and those API return only 4 cases, so even if you provide a 5th label, it will never be used by Docusaurus. Docusaurus selects the string part to use according to the plural rule returned. I don't really understand what you say above 😅 The string parts are not related to the number of documents, but the position of the plural form in that array: ['one', 'two', 'few', 'other'] If n >= 5 in sl is the "other" plural form, it should be the 4th string part of the translation string and not the 5th part. Hope it's clearer? |
Thank you for explanation, it makes sense. If only 4 plurals are available I need to change translation, give me 20 minutes. Point is that, for example "One doc tagged|{count} docs tagged" can be translated two ways. One is "Dokument ima oznako" (document has tag), which is more idiomatic, while other is "Dokument z oznako" (document with tag). Problem is that first requires 5 variations based on number of documents (since when we reach number 5 subject of verb has to change, which changes verb). Second only requires 4 variations (singular, double, few, many) so I will change to it. Thanks! |
Eh sorry, I misremembered. 5c4ea10 is okay. I thought "Štirje dokumentje" was used for fourth case, not "štirje dokumenti". Both are correct, with second having advantage that only four variations are present. |
great, thanks ;) |
…8541) Co-authored-by: Matija Sirk <matija.sirk@kopit.si> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
Pre-flight checklist