Skip to content

Commit 33e3762

Browse files
authored
V1.1.0 (#45)
* feat: sr-ME support (#43) * feat: add sr-ME (Serbian, Montenegro) locale ## New - Add sr-ME to BCP 47 supported locales - Add sr-ME to locales documentation table * chore: upgrade @translated/lara SDK to 1.8.0 ## Changed - Upgrade @translated/lara from 1.7.1 to 1.8.0 * chore: bump version to 1.1.0 ## Changed - Update version in package.json and README badge * fix: handle Ctrl+C gracefully during prompts (#44) * fix: handle Ctrl+C gracefully during prompts ## Changed - Switch `program.parse()` to `program.parseAsync()` to propagate async errors ## New - Catch `ExitPromptError` globally to exit cleanly with "Operation cancelled." message - Add `operationCancelled` message to centralized messages * fix: handle unhandled promise rejection in parseAsync error handler ## Changed - Replace re-thrown error with console.error and process.exit(1) to avoid unhandled promise rejection
1 parent 36bab60 commit 33e3762

7 files changed

Lines changed: 41 additions & 29 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Lara Cli automates translation of your i18n files with a single command, preserv
66

77
Supports multiple file formats including JSON, PO (gettext), TypeScript, Vue I18n single-file components, Markdown and MDX files, and Android XML string resource files. See [Supported Formats](docs/config/formats.md) for details.
88

9-
[![Version](https://img.shields.io/badge/version-1.0.2-blue.svg)](https://github.com/translated/lara-cli)
9+
[![Version](https://img.shields.io/badge/version-1.1.0-blue.svg)](https://github.com/translated/lara-cli)
1010

1111
</div>
1212

docs/config/locales.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -276,23 +276,24 @@ These are standardized language tags defined by BCP 47, combining ISO 639-1 lang
276276
| sl-SI | Slovenian (Slovenia) | sm-WS | Samoan (Samoa) |
277277
| sn-ZW | Shona (Zimbabwe) | so-SO | Somali (Somalia) |
278278
| sq-AL | Albanian (Albania) | sr-Cyrl-RS | Serbian (Cyrillic, Serbia) |
279-
| sr-Latn-RS | Serbian (Latin, Serbia) | ss-SZ | Swati (Eswatini) |
280-
| st-LS | Southern Sotho (Lesotho) | su-ID | Sundanese (Indonesia) |
281-
| sv-SE | Swedish (Sweden) | sw-KE | Swahili (Kenya) |
282-
| szl-PL | Silesian (Poland) | ta-IN | Tamil (India) |
283-
| taq-ML | Tamasheq (Mali) | te-IN | Telugu (India) |
284-
| tg-TJ | Tajik (Tajikistan) | th-TH | Thai (Thailand) |
285-
| ti-ET | Tigrinya (Ethiopia) | tk-TM | Turkmen (Turkmenistan) |
286-
| tl-PH | Tagalog (Philippines) | tn-ZA | Tswana (South Africa) |
287-
| tpi-PG | Tok Pisin (Papua New Guinea) | tr-TR | Turkish (Turkey) |
288-
| ts-ZA | Tsonga (South Africa) | tt-RU | Tatar (Russia) |
289-
| tum-MW | Tumbuka (Malawi) | tw-GH | Twi (Ghana) |
290-
| tzm-MA | Central Atlas Tamazight (Morocco) | ug-CN | Uyghur (China) |
291-
| uk-UA | Ukrainian (Ukraine) | umb-AO | Umbundu (Angola) |
292-
| ur-PK | Urdu (Pakistan) | uzn-UZ | Uzbek (Uzbekistan) |
293-
| vec-IT | Venetian (Italy) | vi-VN | Vietnamese (Vietnam) |
294-
| vls-BE | West Flemish (Belgium) | war-PH | Waray (Philippines) |
295-
| wo-SN | Wolof (Senegal) | xh-ZA | Xhosa (South Africa) |
296-
| ydd-US | Yiddish (United States) | yo-NG | Yoruba (Nigeria) |
297-
| zh-CN | Chinese (Simplified, China) | zh-HK | Chinese (Traditional, Hong Kong) |
298-
| zh-TW | Chinese (Traditional, Taiwan) | zu-ZA | Zulu (South Africa) |
279+
| sr-Latn-RS | Serbian (Latin, Serbia) | sr-ME | Serbian (Montenegro) |
280+
| ss-SZ | Swati (Eswatini) | st-LS | Southern Sotho (Lesotho) |
281+
| su-ID | Sundanese (Indonesia) | sv-SE | Swedish (Sweden) |
282+
| sw-KE | Swahili (Kenya) | szl-PL | Silesian (Poland) |
283+
| ta-IN | Tamil (India) | taq-ML | Tamasheq (Mali) |
284+
| te-IN | Telugu (India) | tg-TJ | Tajik (Tajikistan) |
285+
| th-TH | Thai (Thailand) | ti-ET | Tigrinya (Ethiopia) |
286+
| tk-TM | Turkmen (Turkmenistan) | tl-PH | Tagalog (Philippines) |
287+
| tn-ZA | Tswana (South Africa) | tpi-PG | Tok Pisin (Papua New Guinea) |
288+
| tr-TR | Turkish (Turkey) | ts-ZA | Tsonga (South Africa) |
289+
| tt-RU | Tatar (Russia) | tum-MW | Tumbuka (Malawi) |
290+
| tw-GH | Twi (Ghana) | tzm-MA | Central Atlas Tamazight (Morocco) |
291+
| ug-CN | Uyghur (China) | uk-UA | Ukrainian (Ukraine) |
292+
| umb-AO | Umbundu (Angola) | ur-PK | Urdu (Pakistan) |
293+
| uzn-UZ | Uzbek (Uzbekistan) | vec-IT | Venetian (Italy) |
294+
| vi-VN | Vietnamese (Vietnam) | vls-BE | West Flemish (Belgium) |
295+
| war-PH | Waray (Philippines) | wo-SN | Wolof (Senegal) |
296+
| xh-ZA | Xhosa (South Africa) | ydd-US | Yiddish (United States) |
297+
| yo-NG | Yoruba (Nigeria) | zh-CN | Chinese (Simplified, China) |
298+
| zh-HK | Chinese (Traditional, Hong Kong) | zh-TW | Chinese (Traditional, Taiwan) |
299+
| zu-ZA | Zulu (South Africa) | | |

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@translated/lara-cli",
33
"type": "module",
4-
"version": "1.0.2",
4+
"version": "1.1.0",
55
"description": "CLI tool for automated i18n file translation using Lara Translate",
66
"repository": {
77
"type": "git",
@@ -39,7 +39,7 @@
3939
"@babel/types": "^7.28.6",
4040
"@inquirer/core": "^10.3.2",
4141
"@inquirer/prompts": "^7.10.1",
42-
"@translated/lara": "^1.7.1",
42+
"@translated/lara": "^1.8.0",
4343
"commander": "^14.0.2",
4444
"dotenv": "^17.2.3",
4545
"fast-xml-parser": "^5.3.3",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import { createRequire } from 'node:module';
44
import { Command, Option } from 'commander';
5+
import { ExitPromptError } from '@inquirer/core';
56
import dotenv from 'dotenv';
67

78
dotenv.config({ debug: false, quiet: true });
89

10+
import { Messages } from './messages/messages.js';
911
import initCommand from './cli/cmd/init/init.js';
1012
import translateCommand from './cli/cmd/translate/translate.js';
1113
import memoryCommand from './cli/cmd/memory/memory.js';
@@ -27,6 +29,13 @@ const program = new Command()
2729
.addCommand(glossaryCommand);
2830

2931
// Parse command line arguments
30-
program.parse();
32+
program.parseAsync().catch((error: unknown) => {
33+
if (error instanceof ExitPromptError) {
34+
console.log(`\n${Messages.info.operationCancelled}`);
35+
process.exit(0);
36+
}
37+
console.error(error);
38+
process.exit(1);
39+
});
3140

3241
export default program;

src/messages/messages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export const Messages = {
9999
`${count} ${count === 1 ? 'locale' : 'locales'} already added`,
100100
autoDetected: (count: number) => `${count} auto-detected`,
101101
manuallyAdded: (count: number) => `${count} manually added`,
102+
operationCancelled: 'Operation cancelled.',
102103
},
103104

104105
warnings: {

src/modules/common/common.const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ export const BCP_47_LOCALES = [
371371
'sq-AL',
372372
'sr-Cyrl-RS',
373373
'sr-Latn-RS',
374+
'sr-ME',
374375
'ss-SZ',
375376
'st-LS',
376377
'su-ID',

0 commit comments

Comments
 (0)