Repository navigation
feat(i18n): translate the remaining hardcoded texts through language tokens - #32
Open
lbrunofidelis wants to merge 2 commits into
Open
lbrunofidelis wants to merge 2 commits into
lbrunofidelis wants to merge 2 commits into
Conversation
The dialog and its menu item were hardcoded in Portuguese, and the relationship creation warning in English.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Por que
Alguns textos da interface não passavam pelos tokens de idioma, então não acompanhavam o idioma escolhido. O diálogo "Consulta via API" da lista de contatos e o item de menu dele estavam fixos em português. O aviso exibido quando a criação de um relacionamento falha estava fixo em inglês ("Something went wrong..."). O arquivo local de português (
src/app/i18n/portuguese_pt.ts) estava em português de Portugal: "utilizador", "equipa", "Visualiza múltiplas localidades".Causa
Os textos estavam escritos direto em
contacts-list.component.tse emrelationships-create-view-modify.component.ts, em vez de referenciar tokensLNG_*. O arquivo local de português foi escrito em PT-PT.O que muda
contacts-list.component.ts: o item de menu e o diálogo "Consulta via API" usam os tokensLNG_PAGE_LIST_CONTACTS_ACTION_API_QUERYeLNG_PAGE_LIST_CONTACTS_API_QUERY_DIALOG_*.relationships-create-view-modify.component.ts: o aviso usaLNG_PAGE_CREATE_ENTITY_RELATIONSHIP_ERROR_SOMETHING_WENT_WRONG.src/app/i18n/portuguese_pt.ts: textos em PT-BR, iguais aos do arquivo canônico da API (notificações de equipe, "Ver vários locais").Como validar
npm run migrate-databaseexecutado, abra a lista de contatos em Português e em Inglês: o item "Consulta via API" e o diálogo aparecem no idioma escolhido.Validado
npm run build(produção) ok.eslintnos 3 arquivos tocados: sem erros.english_usbase, na migração2.58.3e no canônico PT-BR da API (check da API com 0 findings).Fora do escopo
english_us.Why (English)
Some UI texts bypassed the language tokens, so they did not follow the selected language. The contacts list "API query" dialog and its menu item were hardcoded in Portuguese, and the relationship creation failure warning was hardcoded in English ("Something went wrong..."). The local Portuguese file (
src/app/i18n/portuguese_pt.ts) was written in European Portuguese.Cause
The texts were written directly in
contacts-list.component.tsandrelationships-create-view-modify.component.tsinstead of referencingLNG_*tokens, and the local Portuguese file used European Portuguese.What changes
contacts-list.component.ts: the menu item and the "API query" dialog useLNG_PAGE_LIST_CONTACTS_ACTION_API_QUERYandLNG_PAGE_LIST_CONTACTS_API_QUERY_DIALOG_*.relationships-create-view-modify.component.ts: the warning usesLNG_PAGE_CREATE_ENTITY_RELATIONSHIP_ERROR_SOMETHING_WENT_WRONG.src/app/i18n/portuguese_pt.ts: Brazilian Portuguese texts, the same as the API canonical file.How to validate
npm run migrate-databaserun, open the contacts list in Portuguese and in English: the "API query" item and dialog follow the selected language.Validated
npm run build(production) ok.eslinton the 3 touched files: no errors.Out of scope
english_us.