This repository has been archived by the owner on Jan 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(i18n): added i18next for user interface translations (#432)
- Loading branch information
1 parent
8d4b3ce
commit 7428384
Showing
76 changed files
with
1,114 additions
and
720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import i18n from 'i18next'; | ||
import { initReactI18next } from 'react-i18next'; | ||
|
||
import translationEN from './translations/en-US.json'; | ||
import translationPT from './translations/pt-BR.json'; | ||
|
||
i18n | ||
// pass the i18n instance to react-i18next. | ||
.use(initReactI18next) | ||
// init i18next | ||
// for all options read: https://www.i18next.com/overview/configuration-options | ||
.init({ | ||
// in case window.VEDACCIO_LANGUAGE is undefined,it will fall back to 'en-US' | ||
lng: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.language, | ||
fallbackLng: 'en-US', | ||
whitelist: ['en-US', 'pt-BR'], | ||
load: 'currentOnly', | ||
resources: { | ||
'en-US': { | ||
translation: translationEN, | ||
}, | ||
'pt-BR': { | ||
translation: translationPT, | ||
}, | ||
}, | ||
debug: false, | ||
interpolation: { | ||
escapeValue: false, // react already safes from xss | ||
}, | ||
}); | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{ | ||
"copy-to-clipboard": "Copy to clipboard", | ||
"author-anonymous": "Anonymous", | ||
"action-bar-action": { | ||
"visit-home-page": "Visit homepage", | ||
"open-an-issue": "Open an issue", | ||
"download-tarball": "Download tarball" | ||
}, | ||
"dialog": { | ||
"registry-info": { | ||
"title": "Register Info" | ||
} | ||
}, | ||
"header": { | ||
"documentation": "Documentation", | ||
"registry-info": "Registry Information", | ||
"greetings": "Hi " | ||
}, | ||
"search": { | ||
"packages": "Search Packages" | ||
}, | ||
"auto-complete": { | ||
"loading": "Loading...", | ||
"no-results-found": "No results found." | ||
}, | ||
"tab": { | ||
"uplinks": "Uplinks", | ||
"versions": "Versions", | ||
"dependencies": "Dependencies", | ||
"readme": "Readme" | ||
}, | ||
"uplinks": { | ||
"title": "Uplinks", | ||
"no-items": "{{name}} has no uplinks." | ||
}, | ||
"versions": { | ||
"current-tags": "Current Tags", | ||
"version-history": "Version history", | ||
"not-available": "Not available" | ||
}, | ||
"package": { | ||
"published-on": "Published on {{time}} •", | ||
"version": "v{{version}}", | ||
"visit-home-page": "Visit homepage", | ||
"homepage": "Homepage", | ||
"open-an-issue": "Open an issue", | ||
"bugs": "Bugs", | ||
"download": "Download {{what}}", | ||
"the-tar-file": "the tar file", | ||
"tarball": "Tarball" | ||
}, | ||
"dependencies": { | ||
"has-no-dependencies": "{{package}} has no dependencies.", | ||
"dependency-block": "{{package}}@{{version}}" | ||
}, | ||
"form": { | ||
"username": "Username", | ||
"password": "Password" | ||
}, | ||
"form-placeholder": { | ||
"username": "Your username", | ||
"password": "Your strong password" | ||
}, | ||
"form-validation": { | ||
"required-field": "This field is required", | ||
"required-min-length": "This field required the min length of {{length}}", | ||
"unable-to-sign-in": "Unable to sign in", | ||
"username-or-password-cant-be-empty": "Username or password can't be empty!" | ||
}, | ||
"help": { | ||
"title": "No Package Published Yet.", | ||
"sub-title": "To publish your first package just:", | ||
"first-step": "1. Login", | ||
"first-step-command-line": "npm adduser --registry {{registryUrl}}", | ||
"second-step": "2. Publish", | ||
"second-step-command-line": "npm publish --registry {{registryUrl}}", | ||
"third-step": "3. Refresh this page." | ||
}, | ||
"sidebar": { | ||
"detail": { | ||
"latest-version": "Latest v{{version}}", | ||
"version": "v{{version}}" | ||
}, | ||
"installation": { | ||
"title": "Installation", | ||
"install-using-yarn": "Install using yarn", | ||
"install-using-yarn-command": "yarn add {{packageName}}", | ||
"install-using-npm": "Install using npm", | ||
"install-using-npm-command": "npm install {{packageName}}", | ||
"install-using-pnpm": "Install using pnpm", | ||
"install-using-pnpm-command": "pnpm install {{packageName}}" | ||
}, | ||
"repository": { | ||
"title": "Repository" | ||
}, | ||
"author": { | ||
"title": "Author" | ||
}, | ||
"distribution": { | ||
"title": "Latest Distribution", | ||
"license": "License", | ||
"size": "Size", | ||
"file-count": "file count" | ||
}, | ||
"maintainers": { | ||
"title": "Maintainers" | ||
}, | ||
"contributors": { | ||
"title": "Contributors" | ||
}, | ||
"engines": { | ||
"npm-version": "NPM Version", | ||
"node-js": "NODE JS" | ||
} | ||
}, | ||
"footer": { | ||
"powered-by": "Powered by", | ||
"made-with-love-on": "Made with <0>♥</0> on" | ||
}, | ||
"button": { | ||
"close": "Close", | ||
"cancel": "Cancel", | ||
"login": "Login", | ||
"logout": "Logout", | ||
"go-to-the-home-page": "Go to the home page", | ||
"learn-more": "Learn More", | ||
"fund-this-package": "<0>Fund</0> this package" | ||
}, | ||
"error": { | ||
"unspecific": "Something went wrong.", | ||
"404": { | ||
"page-not-found": "404 - Page not found", | ||
"sorry-we-could-not-find-it": "Sorry, we couldn't find it..." | ||
}, | ||
"app-context-not-correct-used": "The app context was not correct used", | ||
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{ | ||
"copy-to-clipboard": "Copiar para área de transferência", | ||
"author-anonymous": "Anônimo(a)", | ||
"action-bar-action": { | ||
"visit-home-page": "Visitar a página inicial", | ||
"open-an-issue": "Criar um incidente", | ||
"download-tarball": "Baixar Tarball" | ||
}, | ||
"dialog": { | ||
"registry-info": { | ||
"title": "Informações do Registro" | ||
} | ||
}, | ||
"header": { | ||
"documentation": "Documentação", | ||
"registry-info": "Informações do Registro", | ||
"greetings": "Oi " | ||
}, | ||
"search": { | ||
"packages": "Pesquisar Pacotes" | ||
}, | ||
"auto-complete": { | ||
"loading": "Carregando...", | ||
"no-results-found": "Nenhum resultado encontrado." | ||
}, | ||
"tab": { | ||
"uplinks": "Uplinks", | ||
"versions": "Versões", | ||
"dependencies": "Dependências", | ||
"readme": "Leia-me" | ||
}, | ||
"uplinks": { | ||
"title": "Uplinks", | ||
"no-items": "{{name}} não tem uplinks." | ||
}, | ||
"versions": { | ||
"current-tags": "Tags atuais", | ||
"version-history": "Histórico de versões", | ||
"not-available": "Não disponível" | ||
}, | ||
"package": { | ||
"published-on": "Publicado em {{time}} •", | ||
"version": "v{{version}}", | ||
"visit-home-page": "Visitar a página inicial", | ||
"homepage": "Página inicial", | ||
"open-an-issue": "Criar um incidente", | ||
"bugs": "Erros", | ||
"download": "Baixar {{what}}", | ||
"the-tar-file": "o arquivo tar", | ||
"tarball": "Tarball" | ||
}, | ||
"dependencies": { | ||
"has-no-dependencies": "{{package}} não tem dependências.", | ||
"dependency-block": "{{package}}@{{version}}" | ||
}, | ||
"form": { | ||
"username": "Nome do usuário", | ||
"password": "Senha" | ||
}, | ||
"form-placeholder": { | ||
"username": "O seu nome", | ||
"password": "A sua senha forte" | ||
}, | ||
"form-validation": { | ||
"required-field": "Este campo é obrigatório", | ||
"required-min-length": "Este campo requer o mínimo de {{length}} caracteres", | ||
"unable-to-sign-in": "Não foi possível fazer login", | ||
"username-or-password-cant-be-empty": "Nome de usuário ou senha não podem estar vazios!" | ||
}, | ||
"help": { | ||
"title": "Nenhum pacote publicado ainda.", | ||
"sub-title": "Para publicar seu primeiro pacote apenas:", | ||
"first-step": "1. Faça login", | ||
"first-step-command-line": "npm adduser --registry {{registryUrl}}", | ||
"second-step": "2. Publique", | ||
"second-step-command-line": "npm publish --registry {{registryUrl}}", | ||
"third-step": "3. Atualize esta página." | ||
}, | ||
"sidebar": { | ||
"detail": { | ||
"latest-version": "Última versão: v{{version}}", | ||
"version": "v{{version}}" | ||
}, | ||
"installation": { | ||
"title": "Instalação", | ||
"install-using-yarn": "Instale usando yarn", | ||
"install-using-yarn-command": "yarn add {{packageName}}", | ||
"install-using-npm": "Instale usando npm", | ||
"install-using-npm-command": "npm install {{packageName}}", | ||
"install-using-pnpm": "Instale usando pnpm", | ||
"install-using-pnpm-command": "pnpm install {{packageName}}" | ||
}, | ||
"repository": { | ||
"title": "Repositório" | ||
}, | ||
"author": { | ||
"title": "Autor(a)" | ||
}, | ||
"distribution": { | ||
"title": "Distribuição mais recente", | ||
"license": "Licença", | ||
"size": "Tamanho", | ||
"file-count": "Contagem de arquivos" | ||
}, | ||
"maintainers": { | ||
"title": "Mantenedores(as)" | ||
}, | ||
"contributors": { | ||
"title": "Contribuidores(as)" | ||
}, | ||
"engines": { | ||
"npm-version": "Versão NPM", | ||
"node-js": "NODE JS" | ||
} | ||
}, | ||
"footer": { | ||
"powered-by": "Distribuído por", | ||
"made-with-love-on": "Feito com amor <0>♥</0> no(a)" | ||
}, | ||
"button": { | ||
"close": "Fechar", | ||
"cancel": "Cancelar", | ||
"login": "Conectar", | ||
"logout": "Desconectar", | ||
"go-to-the-home-page": "Ir para a página inicial", | ||
"learn-more": "Leia mais", | ||
"fund-this-package": "<0>Financie</0> este pacote" | ||
}, | ||
"error": { | ||
"unspecific": "Algo deu errado.", | ||
"404": { | ||
"page-not-found": "404 - Página não encontrada", | ||
"sorry-we-could-not-find-it": "Desculpe, não conseguimos encontrar..." | ||
}, | ||
"app-context-not-correct-used": "O contexto do aplicativo não foi usado corretamente", | ||
"package-meta-is-required-at-detail-context": "packageMeta é requerido em DetailContext" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.