From 8be30a734d5aa37a0e10ae249108dc197daf0a7e Mon Sep 17 00:00:00 2001 From: Karol Lassak Date: Fri, 31 Mar 2023 12:09:17 +0200 Subject: [PATCH] feat(i18n): add support for Polish language (#102) * feat(i18n): add support for Polish language --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/githook.ts | 9 ++++++--- src/i18n/index.ts | 10 +++++++--- src/i18n/pl.json | 6 ++++++ 5 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 src/i18n/pl.json diff --git a/package-lock.json b/package-lock.json index 628a5b0..c87ad0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencommit", - "version": "1.1.34", + "version": "1.1.36", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencommit", - "version": "1.1.34", + "version": "1.1.36", "license": "MIT", "dependencies": { "@clack/prompts": "^0.6.1", diff --git a/package.json b/package.json index ea4727e..ddc9cb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencommit", - "version": "1.1.34", + "version": "1.1.36", "description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫", "keywords": [ "git", diff --git a/src/commands/githook.ts b/src/commands/githook.ts index ee3aec6..152d6c6 100755 --- a/src/commands/githook.ts +++ b/src/commands/githook.ts @@ -11,13 +11,16 @@ const platform = process.platform; let separator = ''; switch (platform) { - case 'win32': // Windows + // Windows + case 'win32': separator = path.sep; break; - case 'darwin': // macOS + // macOS + case 'darwin': separator = ''; break; - case 'linux': // Linux + // Linux + case 'linux': separator = ''; break; default: diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 96dbcfa..128f3cf 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -13,6 +13,7 @@ import sv from '../i18n/sv.json' assert { type: 'json' }; import nl from '../i18n/nl.json' assert { type: 'json' }; import ru from '../i18n/ru.json' assert { type: 'json' }; import id_ID from '../i18n/id_ID.json' assert { type: 'json' }; +import pl from '../i18n/pl.json' assert { type: 'json' }; export enum I18nLocals { 'en' = 'en', @@ -28,7 +29,8 @@ export enum I18nLocals { 'es_ES' = 'es_ES', 'sv' = 'sv', 'ru' = 'ru', - 'id_ID' = 'id_ID' + 'id_ID' = 'id_ID', + 'pl' = 'pl', } export const i18n = { @@ -46,7 +48,8 @@ export const i18n = { sv, id_ID, nl, - ru + ru, + pl, }; export const I18N_CONFIG_ALIAS: { [key: string]: string[] } = { @@ -64,7 +67,8 @@ export const I18N_CONFIG_ALIAS: { [key: string]: string[] } = { es_ES: ['es_ES', 'Spanish', 'español'], sv: ['sv', 'Swedish', 'Svenska'], ru: ['ru', 'Russian', 'русский'], - id_ID: ['id_ID', 'Bahasa', 'bahasa'] + id_ID: ['id_ID', 'Bahasa', 'bahasa'], + pl: ['pl', 'Polish', 'Polski'], }; export function getI18nLocal(value: string): string | boolean { diff --git a/src/i18n/pl.json b/src/i18n/pl.json new file mode 100644 index 0000000..d3c2bbb --- /dev/null +++ b/src/i18n/pl.json @@ -0,0 +1,6 @@ +{ + "localLanguage": "polski", + "commitFix": "fix(server.ts): poprawa wielkości zmiennej port na pisane z dużymi literami PORT", + "commitFeat": "feat(server.ts): dodanie obsługi zmiennej środowiskowej process.env.PORT", + "commitDescription": "Zmienna port jest teraz nazwana PORT, co jest zgodne z konwencją nazewniczą ponieważ PORT jest stałą. Obsługa zmiennej środowiskowej process.env.PORT pozwala łatwiej zarządzać ustawieniami przy starcie." +}