mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(v2): update code translations script + update some translations (#4349)
This commit is contained in:
parent
8bc23197a9
commit
4f419801da
3 changed files with 67 additions and 60 deletions
|
@ -13,6 +13,7 @@
|
||||||
"theme.PwaReloadPopup.refreshButtonText": "تحديث",
|
"theme.PwaReloadPopup.refreshButtonText": "تحديث",
|
||||||
"theme.SearchBar.label": "بحث",
|
"theme.SearchBar.label": "بحث",
|
||||||
"theme.SearchPage.algoliaLabel": "البحث بواسطه Algolia",
|
"theme.SearchPage.algoliaLabel": "البحث بواسطه Algolia",
|
||||||
|
"theme.SearchPage.documentsFound.plurals": "One document found|{count} documents found",
|
||||||
"theme.SearchPage.emptyResultsTitle": "ابحث في الوثائق",
|
"theme.SearchPage.emptyResultsTitle": "ابحث في الوثائق",
|
||||||
"theme.SearchPage.existingResultsTitle": "نتائج البحث عن \"{query}\"",
|
"theme.SearchPage.existingResultsTitle": "نتائج البحث عن \"{query}\"",
|
||||||
"theme.SearchPage.fetchingNewResults": "جلب نتائج جديدة ...",
|
"theme.SearchPage.fetchingNewResults": "جلب نتائج جديدة ...",
|
||||||
|
@ -22,13 +23,12 @@
|
||||||
"theme.blog.paginator.navAriaLabel": "التنقل في صفحة قائمة المدونة",
|
"theme.blog.paginator.navAriaLabel": "التنقل في صفحة قائمة المدونة",
|
||||||
"theme.blog.paginator.newerEntries": "إدخالات أحدث",
|
"theme.blog.paginator.newerEntries": "إدخالات أحدث",
|
||||||
"theme.blog.paginator.olderEntries": "إدخالات أقدم",
|
"theme.blog.paginator.olderEntries": "إدخالات أقدم",
|
||||||
"theme.blog.post.nPosts": "{count} مقالات",
|
|
||||||
"theme.blog.post.onePost": "مقاله واحده",
|
|
||||||
"theme.blog.post.paginator.navAriaLabel": "التنقل في صفحة مقالات المدونة",
|
"theme.blog.post.paginator.navAriaLabel": "التنقل في صفحة مقالات المدونة",
|
||||||
"theme.blog.post.paginator.newerPost": "مقالات أحدث",
|
"theme.blog.post.paginator.newerPost": "مقالات أحدث",
|
||||||
"theme.blog.post.paginator.olderPost": "مقالات أقدم",
|
"theme.blog.post.paginator.olderPost": "مقالات أقدم",
|
||||||
|
"theme.blog.post.plurals": "مقاله واحده|{count} مقالات",
|
||||||
"theme.blog.post.readMore": "اقرأ المزيد",
|
"theme.blog.post.readMore": "اقرأ المزيد",
|
||||||
"theme.blog.post.readingTime": "{readingTime} دقائق قراءة",
|
"theme.blog.post.readingTime.plurals": "{readingTime} دقائق قراءة|{readingTime} دقائق قراءة",
|
||||||
"theme.blog.tagTitle": "{nPosts} موسومة ب \"{tagName}\"",
|
"theme.blog.tagTitle": "{nPosts} موسومة ب \"{tagName}\"",
|
||||||
"theme.common.editThisPage": "تعديل هذه الصفحة",
|
"theme.common.editThisPage": "تعديل هذه الصفحة",
|
||||||
"theme.common.headingLinkTitle": "ارتباط مباشر بالعنوان",
|
"theme.common.headingLinkTitle": "ارتباط مباشر بالعنوان",
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
"theme.PwaReloadPopup.refreshButtonText": "Odśwież",
|
"theme.PwaReloadPopup.refreshButtonText": "Odśwież",
|
||||||
"theme.SearchBar.label": "Szukaj",
|
"theme.SearchBar.label": "Szukaj",
|
||||||
"theme.SearchPage.algoliaLabel": "Dostawca rozwiązania Algolia",
|
"theme.SearchPage.algoliaLabel": "Dostawca rozwiązania Algolia",
|
||||||
|
"theme.SearchPage.documentsFound.plurals": "One document found|{count} documents found",
|
||||||
"theme.SearchPage.emptyResultsTitle": "Wyszukaj w dokumentacji",
|
"theme.SearchPage.emptyResultsTitle": "Wyszukaj w dokumentacji",
|
||||||
"theme.SearchPage.existingResultsTitle": "Wyniki wyszukiwania dla \"{query}\"",
|
"theme.SearchPage.existingResultsTitle": "Wyniki wyszukiwania dla \"{query}\"",
|
||||||
"theme.SearchPage.fetchingNewResults": "Pobieranie nowych wyników…",
|
"theme.SearchPage.fetchingNewResults": "Pobieranie nowych wyników…",
|
||||||
|
@ -22,13 +23,12 @@
|
||||||
"theme.blog.paginator.navAriaLabel": "Nawigacja na stronie listy wpisów na blogu",
|
"theme.blog.paginator.navAriaLabel": "Nawigacja na stronie listy wpisów na blogu",
|
||||||
"theme.blog.paginator.newerEntries": "Nowsze wpisy",
|
"theme.blog.paginator.newerEntries": "Nowsze wpisy",
|
||||||
"theme.blog.paginator.olderEntries": "Starsze wpisy",
|
"theme.blog.paginator.olderEntries": "Starsze wpisy",
|
||||||
"theme.blog.post.nPosts": "{count} posty",
|
|
||||||
"theme.blog.post.onePost": "Jeden post",
|
|
||||||
"theme.blog.post.paginator.navAriaLabel": "Nawigacja na stronie postu na blogu",
|
"theme.blog.post.paginator.navAriaLabel": "Nawigacja na stronie postu na blogu",
|
||||||
"theme.blog.post.paginator.newerPost": "Nowszy posty",
|
"theme.blog.post.paginator.newerPost": "Nowszy posty",
|
||||||
"theme.blog.post.paginator.olderPost": "Starszy posty",
|
"theme.blog.post.paginator.olderPost": "Starszy posty",
|
||||||
|
"theme.blog.post.plurals": "Jeden post|{count} posty|{count} postów",
|
||||||
"theme.blog.post.readMore": "Czytaj więcej",
|
"theme.blog.post.readMore": "Czytaj więcej",
|
||||||
"theme.blog.post.readingTime": "{readingTime} min aby przeczytać",
|
"theme.blog.post.readingTime.plurals": "{readingTime} min aby przeczytać|{readingTime} min aby przeczytać|{readingTime} min aby przeczytać",
|
||||||
"theme.blog.tagTitle": "{nPosts} z tagiem \"{tagName}\"",
|
"theme.blog.tagTitle": "{nPosts} z tagiem \"{tagName}\"",
|
||||||
"theme.common.editThisPage": "Edytuj tą stronę",
|
"theme.common.editThisPage": "Edytuj tą stronę",
|
||||||
"theme.common.headingLinkTitle": "Bezpośredni link do nagłówka",
|
"theme.common.headingLinkTitle": "Bezpośredni link do nagłówka",
|
||||||
|
|
|
@ -9,7 +9,7 @@ const chalk = require('chalk');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const globby = require('globby');
|
const globby = require('globby');
|
||||||
const {mapValues, difference} = require('lodash');
|
const {mapValues, pickBy, difference} = require('lodash');
|
||||||
|
|
||||||
const CodeDirPaths = [
|
const CodeDirPaths = [
|
||||||
path.join(__dirname, 'lib-next'),
|
path.join(__dirname, 'lib-next'),
|
||||||
|
@ -101,8 +101,14 @@ async function getCodeTranslationFiles() {
|
||||||
return {baseFile, localesFiles};
|
return {baseFile, localesFiles};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const DescriptionSuffix = '___DESCRIPTION';
|
||||||
|
|
||||||
async function updateBaseFile(baseFile) {
|
async function updateBaseFile(baseFile) {
|
||||||
const baseMessages = await readMessagesFile(baseFile);
|
const baseMessagesWithDescriptions = await readMessagesFile(baseFile);
|
||||||
|
const baseMessages = pickBy(
|
||||||
|
baseMessagesWithDescriptions,
|
||||||
|
(_, key) => !key.endsWith(DescriptionSuffix),
|
||||||
|
);
|
||||||
|
|
||||||
const codeExtractedTranslations = await extractThemeCodeMessages();
|
const codeExtractedTranslations = await extractThemeCodeMessages();
|
||||||
const codeMessages = mapValues(
|
const codeMessages = mapValues(
|
||||||
|
@ -132,7 +138,8 @@ ${logKeys(unknownMessages)}`),
|
||||||
(acc, [key]) => {
|
(acc, [key]) => {
|
||||||
return {
|
return {
|
||||||
...acc,
|
...acc,
|
||||||
[`${key}___DESCRIPTION`]: codeExtractedTranslations[key].description,
|
[`${key}${DescriptionSuffix}`]: codeExtractedTranslations[key]
|
||||||
|
.description,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue