Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

fix(i18n): fit the russian store description in 132 characters (#196)

Luis Ortiz890b6dc5a966
diff --git a/packages/locales/ru.yml b/packages/locales/ru.yml
index bda69bd..e821b3f 100644
--- a/packages/locales/ru.yml
+++ b/packages/locales/ru.yml
@@ -4,7 +4,7 @@ meta:
app:
name: Mimik
store_title: "Mimik: ΠΏΠΎΡˆΠ°Π³ΠΎΠ²Ρ‹Π΅ Π³Π°ΠΉΠ΄Ρ‹ ΠΈ инструкции"
- description: "ЗаписывайтС любой сцСнарий Π² Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅ ΠΊΠ°ΠΊ ΠΏΠΎΡˆΠ°Π³ΠΎΠ²Ρ‹ΠΉ Π³Π°ΠΉΠ΄. Π Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΡƒΠΉΡ‚Π΅, ΠΎΠ·Π²ΡƒΡ‡ΠΈΠ²Π°ΠΉΡ‚Π΅, экспортируйтС Π² Π²ΠΈΠ΄Π΅ΠΎ, PDF ΠΈΠ»ΠΈ DOCX. Π”Π°Π½Π½Ρ‹Π΅ Π½Π΅ ΠΏΠΎΠΊΠΈΠ΄Π°ΡŽΡ‚ Π±Ρ€Π°ΡƒΠ·Π΅Ρ€, ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹ΠΉ исходный ΠΊΠΎΠ΄."
+ description: "ЗаписывайтС любой сцСнарий Π² Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅ ΠΊΠ°ΠΊ ΠΏΠΎΡˆΠ°Π³ΠΎΠ²Ρ‹ΠΉ Π³Π°ΠΉΠ΄. ΠŸΡ€Π°Π²ΠΊΠ°, ΠΎΠ·Π²ΡƒΡ‡ΠΊΠ°, экспорт Π² Π²ΠΈΠ΄Π΅ΠΎ, PDF ΠΈΠ»ΠΈ DOCX. Π›ΠΎΠΊΠ°Π»ΡŒΠ½ΠΎ, ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹ΠΉ ΠΊΠΎΠ΄."
common:
loading: Π—Π°Π³Ρ€ΡƒΠ·ΠΊΠ°...
diff --git a/scripts/check-locale-keys.mjs b/scripts/check-locale-keys.mjs
index dff2cdf..5f3c438 100644
--- a/scripts/check-locale-keys.mjs
+++ b/scripts/check-locale-keys.mjs
@@ -22,3 +22,22 @@ if (problems.length > 0) {
console.error(`\n${problems.length} translation key(s) use _ where both surfaces write a dot`);
process.exit(1);
}
+
+const LOCALES = 'packages/locales';
+const STORE_LIMITS = { store_title: 45, description: 132 };
+
+const tooLong = readdirSync(LOCALES)
+ .filter((name) => name.endsWith('.yml'))
+ .flatMap((name) => {
+ const app = readFileSync(join(LOCALES, name), 'utf8').match(/^app:\n((?: {2}.*\n)+)/m)?.[1] ?? '';
+ return Object.entries(STORE_LIMITS).flatMap(([key, max]) => {
+ const value = app.match(new RegExp(`^ {2}${key}: "?(.*?)"?$`, 'm'))?.[1] ?? '';
+ const length = [...value].length;
+ return length > max ? [`${name} app.${key} is ${length} characters, the store limit is ${max}`] : [];
+ });
+ });
+
+if (tooLong.length > 0) {
+ console.error(tooLong.join('\n'));
+ process.exit(1);
+}