Skip to content

Commit

Permalink
feat(app): pt-BR translation
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Oct 30, 2018
1 parent d104486 commit f089c20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/app/engines/i18n.engine.ts
@@ -1,6 +1,11 @@
import i18next from 'i18next';

import { TRANSLATION_EN_US, TRANSLATION_FR_FR, TRANSLATION_ZH_CN } from '../../locales';
import {
TRANSLATION_EN_US,
TRANSLATION_FR_FR,
TRANSLATION_ZH_CN,
TRANSLATION_PT_BR
} from '../../locales';

class I18nEngine {
private static instance: I18nEngine;
Expand All @@ -15,7 +20,8 @@ class I18nEngine {
private availablesLanguages = {
'en-US': 'en-US',
'fr-FR': 'fr-FR',
'zh-CN': 'zh-CN'
'zh-CN': 'zh-CN',
'pt-BR': 'pt-BR'
};

public fallbackLanguage = 'en-US';
Expand All @@ -28,6 +34,7 @@ class I18nEngine {
i18next.addResources('en-US', 'translation', TRANSLATION_EN_US);
i18next.addResources('fr-FR', 'translation', TRANSLATION_FR_FR);
i18next.addResources('zh-CN', 'translation', TRANSLATION_ZH_CN);
i18next.addResources('pt-BR', 'translation', TRANSLATION_PT_BR);
}

public translate(key: string): string {
Expand Down
2 changes: 1 addition & 1 deletion src/index-cli.ts
Expand Up @@ -80,7 +80,7 @@ export class CliApplication extends Application {
'Export in specified format (json, html)',
COMPODOC_DEFAULTS.exportFormat
)
.option('--language [language]', 'Language used for the generated documentation (en-US, fr-FR, zh-CN)', COMPODOC_DEFAULTS.language)
.option('--language [language]', 'Language used for the generated documentation (en-US, fr-FR, zh-CN, pt-BR)', COMPODOC_DEFAULTS.language)
.option(
'--theme [theme]',
"Choose one of available themes, default is 'gitbook' (laravel, original, material, postmark, readthedocs, stripe, vagrant)"
Expand Down

0 comments on commit f089c20

Please sign in to comment.