mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
feat(i18n): add support for Portuguese (Brazil) language (pt_br) (#34)
* feat(i18n): add support for Portuguese (Brazil) language (pt_br)
This commit is contained in:
18
README.md
18
README.md
@@ -84,6 +84,24 @@ To remove description:
|
||||
oc config set description=false
|
||||
```
|
||||
|
||||
### Internationalization support
|
||||
|
||||
To specify the language used to generate commit messages:
|
||||
|
||||
```sh
|
||||
# de, German ,Deutsch
|
||||
oc config set language=de
|
||||
oc config set language=German
|
||||
oc config set language=Deutsch
|
||||
|
||||
# fr, French, française
|
||||
oc config set language=fr
|
||||
oc config set language=French
|
||||
oc config set language=française
|
||||
```
|
||||
The default language set is **English**
|
||||
All available languages are currently listed in the [i18n](https://github.com/di-sukharev/opencommit/tree/master/src/i18n) folder
|
||||
|
||||
### Git flags
|
||||
|
||||
The `opencommit` or `oc` commands can be used in place of the `git commit -m "${generatedMessage}"` command. This means that any regular flags that are used with the `git commit` command will also be applied when using `opencommit` or `oc`.
|
||||
|
||||
@@ -6,6 +6,7 @@ import ko from '../i18n/ko.json' assert { type: 'json' };
|
||||
import zh_CN from '../i18n/zh_CN.json' assert { type: 'json' };
|
||||
import zh_TW from '../i18n/zh_TW.json' assert { type: 'json' };
|
||||
import ja from '../i18n/ja.json' assert { type: 'json' };
|
||||
import pt_br from '../i18n/pt_br.json' assert { type: 'json' };
|
||||
|
||||
export enum I18nLocals {
|
||||
'en' = 'en',
|
||||
@@ -15,7 +16,8 @@ export enum I18nLocals {
|
||||
'de' = 'de',
|
||||
'fr' = 'fr',
|
||||
'it' = 'it',
|
||||
'ko' = 'ko'
|
||||
'ko' = 'ko',
|
||||
'pt_br' = 'pt_br'
|
||||
};
|
||||
|
||||
export const i18n = {
|
||||
@@ -27,6 +29,7 @@ export const i18n = {
|
||||
fr,
|
||||
it,
|
||||
ko,
|
||||
pt_br
|
||||
};
|
||||
|
||||
export const I18N_CONFIG_ALIAS: { [key: string]: string[] } = {
|
||||
@@ -37,6 +40,8 @@ export const I18N_CONFIG_ALIAS: { [key: string]: string[] } = {
|
||||
de: ['de', 'German' ,'Deutsch'],
|
||||
fr: ['fr', 'French', 'française'],
|
||||
it: ['it', 'Italian', 'italiano'],
|
||||
pt_br: ['pt_br', 'Portuguese', 'português'],
|
||||
en: ['en', 'English', 'english'],
|
||||
};
|
||||
|
||||
export function getI18nLocal(value: string): string | boolean {
|
||||
|
||||
7
src/i18n/pt_br.json
Normal file
7
src/i18n/pt_br.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"localLanguage": "português",
|
||||
"commitFix": "fix(server.ts): altera o caso da variável de porta de port minúscula para PORT maiúscula",
|
||||
"commitFeat": "feat(server.ts): adiciona suporte para a variável de ambiente process.env.PORT",
|
||||
"commitDescription": "A variável de porta agora é denominada PORT, o que melhora a consistência com as convenções de nomenclatura, pois PORT é uma constante. O suporte para uma variável de ambiente permite que o aplicativo seja mais flexível, pois agora pode ser executado em qualquer porta disponível especificada por meio da variável de ambiente process.env.PORT."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user