localingos 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/extract.js +8 -8
package/package.json
CHANGED
package/src/commands/extract.js
CHANGED
|
@@ -264,13 +264,6 @@ export function defineMessages<K extends string>(
|
|
|
264
264
|
}
|
|
265
265
|
\`\`\`
|
|
266
266
|
|
|
267
|
-
- **Add a language/locale selector** to the app UI in the most appropriate, visible location (e.g., navigation bar, header, settings page, or footer). The selector must:
|
|
268
|
-
- Display the available locales based on the translation files present in \`${outputDir}/\`
|
|
269
|
-
- Allow users to switch languages at runtime
|
|
270
|
-
- Persist the user's language preference (e.g., localStorage)
|
|
271
|
-
- Use the project's i18n framework to change the active locale (e.g., \`i18n.changeLanguage(locale)\` for i18next)
|
|
272
|
-
- Show locale names in their native language when possible (e.g., "Español" not "Spanish", "Deutsch" not "German")
|
|
273
|
-
- If a locale selector component already exists in the project, update it rather than creating a duplicate`;
|
|
274
267
|
---
|
|
275
268
|
|
|
276
269
|
### Step 2: For EVERY component with translatable strings, create a co-located \`*${msgExt}\` file
|
|
@@ -429,7 +422,14 @@ ${messageDefinitionSection}${nonJsI18nInstructions}
|
|
|
429
422
|
- If a string contains dynamic values like \`\${name}\` or \`{count}\`, use the i18n library's interpolation syntax: \`"Hello, {name}"\` in the source file, \`t('key', { name })\` in the code
|
|
430
423
|
- Maintain the original text exactly as-is in the source file (in ${languageName})${isJsProject ? `
|
|
431
424
|
- After creating all message files, run the extraction script to generate \`${sourceFile}\` from the message definitions` : ''}
|
|
432
|
-
- After this is done, running \`localingos sync\` will push the source strings to Localingos and pull back translations for other languages — the app should already be wired to load those translated files from \`${outputDir}
|
|
425
|
+
- After this is done, running \`localingos sync\` will push the source strings to Localingos and pull back translations for other languages — the app should already be wired to load those translated files from \`${outputDir}/\`
|
|
426
|
+
- **Add a language/locale selector** to the app UI in the most appropriate, visible location (e.g., navigation bar, header, settings page, or footer). The selector must:
|
|
427
|
+
- Display the available locales based on the translation files present in \`${outputDir}/\`
|
|
428
|
+
- Allow users to switch languages at runtime
|
|
429
|
+
- Persist the user's language preference (e.g., localStorage)
|
|
430
|
+
- Use the project's i18n framework to change the active locale (e.g., \`i18n.changeLanguage(locale)\` for i18next)
|
|
431
|
+
- Show locale names in their native language when possible (e.g., "Español" not "Spanish", "Deutsch" not "German")
|
|
432
|
+
- If a locale selector component already exists in the project, update it rather than creating a duplicate`;
|
|
433
433
|
|
|
434
434
|
// Print the prompt
|
|
435
435
|
console.log(chalk.blue('🤖 AI Extraction Prompt'));
|