fix(v2): update code translations script + update some translations (#4349)

This commit is contained in:
Sébastien Lorber 2021-03-05 14:52:59 +01:00 committed by GitHub
parent 8bc23197a9
commit 4f419801da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 60 deletions

View file

@ -1,55 +1,55 @@
{ {
"theme.AnnouncementBar.closeButtonAriaLabel": "إغلاق", "theme.AnnouncementBar.closeButtonAriaLabel": "إغلاق",
"theme.CodeBlock.copied": "تم النسخ", "theme.CodeBlock.copied": "تم النسخ",
"theme.CodeBlock.copy": "نسخ", "theme.CodeBlock.copy": "نسخ",
"theme.CodeBlock.copyButtonAriaLabel": "نسخ الرمز إلى الحافظة", "theme.CodeBlock.copyButtonAriaLabel": "نسخ الرمز إلى الحافظة",
"theme.NotFound.p1": "لم نتمكن من العثور على ما كنت تبحث عنه.", "theme.NotFound.p1": "لم نتمكن من العثور على ما كنت تبحث عنه.",
"theme.NotFound.p2": "يرجى الاتصال بمالك الموقع الذي ربطك بعنوان URL الأصلي وإخباره بأن الارتباط الخاص به معطل.", "theme.NotFound.p2": "يرجى الاتصال بمالك الموقع الذي ربطك بعنوان URL الأصلي وإخباره بأن الارتباط الخاص به معطل.",
"theme.NotFound.title": "الصفحة غير موجودة", "theme.NotFound.title": "الصفحة غير موجودة",
"theme.Playground.liveEditor": "محرر مباشر", "theme.Playground.liveEditor": "محرر مباشر",
"theme.Playground.result": "النتيجة", "theme.Playground.result": "النتيجة",
"theme.PwaReloadPopup.closeButtonAriaLabel": "إغلاق", "theme.PwaReloadPopup.closeButtonAriaLabel": "إغلاق",
"theme.PwaReloadPopup.info": "نسخة جديدة متاحة", "theme.PwaReloadPopup.info": "نسخة جديدة متاحة",
"theme.PwaReloadPopup.refreshButtonText": "تحديث", "theme.PwaReloadPopup.refreshButtonText": "تحديث",
"theme.SearchBar.label": "بحث", "theme.SearchBar.label": "بحث",
"theme.SearchPage.algoliaLabel": "البحث بواسطه Algolia", "theme.SearchPage.algoliaLabel": "البحث بواسطه Algolia",
"theme.SearchPage.emptyResultsTitle": "ابحث في الوثائق", "theme.SearchPage.documentsFound.plurals": "One document found|{count} documents found",
"theme.SearchPage.existingResultsTitle": "نتائج البحث عن \"{query}\"", "theme.SearchPage.emptyResultsTitle": "ابحث في الوثائق",
"theme.SearchPage.fetchingNewResults": "جلب نتائج جديدة ...", "theme.SearchPage.existingResultsTitle": "نتائج البحث عن \"{query}\"",
"theme.SearchPage.inputLabel": "بحث", "theme.SearchPage.fetchingNewResults": "جلب نتائج جديدة ...",
"theme.SearchPage.inputPlaceholder": "اكتب ما تبحث عنه هنا", "theme.SearchPage.inputLabel": "بحث",
"theme.SearchPage.noResultsText": "لم يتم العثور على نتائج", "theme.SearchPage.inputPlaceholder": "اكتب ما تبحث عنه هنا",
"theme.blog.paginator.navAriaLabel": "التنقل في صفحة قائمة المدونة", "theme.SearchPage.noResultsText": "لم يتم العثور على نتائج",
"theme.blog.paginator.newerEntries": "إدخالات أحدث", "theme.blog.paginator.navAriaLabel": "التنقل في صفحة قائمة المدونة",
"theme.blog.paginator.olderEntries": "إدخالات أقدم", "theme.blog.paginator.newerEntries": "إدخالات أحدث",
"theme.blog.post.nPosts": "{count} مقالات", "theme.blog.paginator.olderEntries": "إدخالات أقدم",
"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": "ارتباط مباشر بالعنوان",
"theme.common.skipToMainContent": "انتقل إلى المحتوى الرئيسي", "theme.common.skipToMainContent": "انتقل إلى المحتوى الرئيسي",
"theme.docs.paginator.navAriaLabel": "التنقل بين صفحات المستندات", "theme.docs.paginator.navAriaLabel": "التنقل بين صفحات المستندات",
"theme.docs.paginator.next": "التالى", "theme.docs.paginator.next": "التالى",
"theme.docs.paginator.previous": "السابق", "theme.docs.paginator.previous": "السابق",
"theme.docs.sidebar.collapseButtonAriaLabel": "طي الشريط الجانبي", "theme.docs.sidebar.collapseButtonAriaLabel": "طي الشريط الجانبي",
"theme.docs.sidebar.collapseButtonTitle": "طي الشريط الجانبي", "theme.docs.sidebar.collapseButtonTitle": "طي الشريط الجانبي",
"theme.docs.sidebar.expandButtonAriaLabel": "توسيع الشريط الجانبي", "theme.docs.sidebar.expandButtonAriaLabel": "توسيع الشريط الجانبي",
"theme.docs.sidebar.expandButtonTitle": "توسيع الشريط الجانبي", "theme.docs.sidebar.expandButtonTitle": "توسيع الشريط الجانبي",
"theme.docs.sidebar.responsiveCloseButtonLabel": "إغلاق القائمة", "theme.docs.sidebar.responsiveCloseButtonLabel": "إغلاق القائمة",
"theme.docs.sidebar.responsiveOpenButtonLabel": "فتح القائمة", "theme.docs.sidebar.responsiveOpenButtonLabel": "فتح القائمة",
"theme.docs.versions.latestVersionLinkLabel": "احدث اصدار", "theme.docs.versions.latestVersionLinkLabel": "احدث اصدار",
"theme.docs.versions.latestVersionSuggestionLabel": "للحصول على أحدث الوثائق، راجع {latestVersionLink} ({versionLabel}).", "theme.docs.versions.latestVersionSuggestionLabel": "للحصول على أحدث الوثائق، راجع {latestVersionLink} ({versionLabel}).",
"theme.docs.versions.unmaintainedVersionLabel": "هذه هي وثائق {siteTitle} {versionLabel}، التي لم تعد تتم صيانتها بشكل نشط.", "theme.docs.versions.unmaintainedVersionLabel": "هذه هي وثائق {siteTitle} {versionLabel}، التي لم تعد تتم صيانتها بشكل نشط.",
"theme.docs.versions.unreleasedVersionLabel": "هذه وثائق لم يتم طرحها لإصدار {siteTitle} {versionLabel}.", "theme.docs.versions.unreleasedVersionLabel": "هذه وثائق لم يتم طرحها لإصدار {siteTitle} {versionLabel}.",
"theme.lastUpdated.atDate": " في {date}", "theme.lastUpdated.atDate": " في {date}",
"theme.lastUpdated.byUser": " بواسطة {user}", "theme.lastUpdated.byUser": " بواسطة {user}",
"theme.lastUpdated.lastUpdatedAtBy": "آخر تحديث{atDate}{byUser}", "theme.lastUpdated.lastUpdatedAtBy": "آخر تحديث{atDate}{byUser}",
"theme.tags.tagsListLabel": "الوسوم:", "theme.tags.tagsListLabel": "الوسوم:",
"theme.tags.tagsPageLink": "عرض كل الوسوم", "theme.tags.tagsPageLink": "عرض كل الوسوم",
"theme.tags.tagsPageTitle": "الوسوم" "theme.tags.tagsPageTitle": "الوسوم"
} }

View file

@ -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",

View file

@ -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,
}; };
}, },
{}, {},