summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad RAHMANI2023-08-14 22:25:59 +0200
committerGitHub2023-08-14 22:25:59 +0200
commit3c87a16de3c867ad89294a0ea84d63eca2e74d7a (patch)
tree5870bbc051d9c201768c89a46b0204d0d4225f1e
parentcd28392ac73ac0ba1a441328fcd1d65d7d441366 (diff)
downloadIT.starlight-3c87a16de3c867ad89294a0ea84d63eca2e74d7a.tar.gz
IT.starlight-3c87a16de3c867ad89294a0ea84d63eca2e74d7a.tar.bz2
IT.starlight-3c87a16de3c867ad89294a0ea84d63eca2e74d7a.zip
Add Farsi UI Translations (#502)
* + Adding Farsi ui Translations * Add changeset --------- Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--.changeset/real-elephants-heal.md5
-rw-r--r--docs/src/content/docs/guides/i18n.mdx2
-rw-r--r--packages/starlight/translations/fa.json22
-rw-r--r--packages/starlight/translations/index.ts3
4 files changed, 30 insertions, 2 deletions
diff --git a/.changeset/real-elephants-heal.md b/.changeset/real-elephants-heal.md
new file mode 100644
index 00000000..32c65563
--- /dev/null
+++ b/.changeset/real-elephants-heal.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/starlight": patch
+---
+
+Add Farsi UI translations
diff --git a/docs/src/content/docs/guides/i18n.mdx b/docs/src/content/docs/guides/i18n.mdx
index 34f813eb..e4dabb38 100644
--- a/docs/src/content/docs/guides/i18n.mdx
+++ b/docs/src/content/docs/guides/i18n.mdx
@@ -143,7 +143,7 @@ If a translation is not yet available for a language, Starlight will show reader
In addition to hosting translated content files, Starlight allows you to translate the default UI strings (e.g. the "On this page" heading in the table of contents) so that your readers can experience your site entirely in the selected language.
-English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, and Simplified Chinese translated UI strings are provided out of the box, and we welcome [contributions to add more default languages](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
+English, Czech, French, German, Italian, Japanese, Portuguese, Dutch, Danish, Spanish, Turkish, Arabic, Norwegian, Farsi, and Simplified Chinese translated UI strings are provided out of the box, and we welcome [contributions to add more default languages](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md).
You can provide translations for additional languages you support — or override our default labels — via the `i18n` data collection.
diff --git a/packages/starlight/translations/fa.json b/packages/starlight/translations/fa.json
new file mode 100644
index 00000000..7293511b
--- /dev/null
+++ b/packages/starlight/translations/fa.json
@@ -0,0 +1,22 @@
+{
+ "skipLink.label": "رفتن به محتوا",
+ "search.label": "جستجو",
+ "search.shortcutLabel": "(برای جستجو / را فشار دهید)",
+ "search.cancelLabel": "لغو",
+ "search.devWarning": "جستجو تنها در نسخه‌های تولیدی در دسترس است. \nسعی کنید سایت را بسازید و پیش‌نمایش آن را به صورت محلی آزمایش کنید.",
+ "themeSelect.accessibleLabel": "انتخاب پوسته",
+ "themeSelect.dark": "تیره",
+ "themeSelect.light": "روشن",
+ "themeSelect.auto": "خودکار",
+ "languageSelect.accessibleLabel": "انتخاب زبان",
+ "menuButton.accessibleLabel": "منو",
+ "sidebarNav.accessibleLabel": "اصلی",
+ "tableOfContents.onThisPage": "در این صفحه",
+ "tableOfContents.overview": "بررسی اجمالی",
+ "i18n.untranslatedContent": "این محتوا هنوز به زبان شما در دسترس نیست.",
+ "page.editLink": "ویرایش صفحه",
+ "page.lastUpdated": "آخرین به روز رسانی:",
+ "page.previousLink": "قبلی",
+ "page.nextLink": "بعدی",
+ "404.text": "صفحه یافت نشد. لطفاً URL را بررسی کنید یا از جستجو استفاده نمایید."
+ } \ No newline at end of file
diff --git a/packages/starlight/translations/index.ts b/packages/starlight/translations/index.ts
index 5481912f..9343caa2 100644
--- a/packages/starlight/translations/index.ts
+++ b/packages/starlight/translations/index.ts
@@ -5,6 +5,7 @@ import es from './es.json';
import de from './de.json';
import ja from './ja.json';
import pt from './pt.json';
+import fa from './fa.json';
import fr from './fr.json';
import it from './it.json';
import nl from './nl.json';
@@ -17,7 +18,7 @@ import zh from './zh.json';
const { parse } = builtinI18nSchema();
export default Object.fromEntries(
- Object.entries({ cs, en, es, de, ja, pt, fr, it, nl, da, tr, ar, nb, zh }).map(([key, dict]) => [
+ Object.entries({ cs, en, es, de, ja, pt, fa, fr, it, nl, da, tr, ar, nb, zh }).map(([key, dict]) => [
key,
parse(dict),
])