-
Notifications
You must be signed in to change notification settings - Fork 77
misc: Add pt_BR translation #2283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a16259d
to
1c2abeb
Compare
Oi @fgmacedo, Thanks a lot for your work! Did you also have a chance to add Brazilian Portuguese support on the API side? Just a heads-up: I’ll need to re-open this PR on my end due to a missing CI configuration that would otherwise block the merge. You’ll still be credited as the author of all the commits, of course. Thanks again! |
1c2abeb
to
bdabe62
Compare
Hi @ansmonjol , I'm still working on the API side and a PR is coming soon. |
Hi @ansmonjol , I've submitted a PR to the api side: getlago/lago-api#3872. Please let me know if something is missing. |
Hey @fgmacedo, |
Hi @ansmonjol , I was not able to find where to switch language for the frontend translation, but the change language for the invoice settings did worked: Request (made by the UI as curl here):
Response:
|
Indeed, I was probably having set it up wrongly on my side, my bad! I've pushed the fix on your BE branch fixing a locale key definition leading to error on document generation. I'll check for some other documents and email, if they are well generated, and try to merge this asap! |
Have to re-open the PR on our side otherwise the e2e CI will not pass |
## Context Adding Brazilian Portuguese (pt_BR) translation. Related to getlago/lago-front#2283 --------- Co-authored-by: Alexandre Monjol <alexandre.monjol@gmail.com>
Been re-opened and merged here #2298 |
Done! Thanks for your work @fgmacedo |
@ansmonjol Thanks for integrating this! Is there a way to change the frontend language in the UI? I indeed check if the translations are right, by mocking the function export const getTranslations: (locale: Locale) => Promise<Record<string, string>> = async (
locale,
) => {
locale = 'pt_BR';
let loadedTranslation: Translation
// Translations are dinamically imported according to the selected locale
try {
loadedTranslation = (await import(`../../../translations/${locale}.json`)) as Translation
} catch {
loadedTranslation = (await import(`../../../translations/base.json`)) as unknown as Translation
}
return loadedTranslation
} And it indeed changed the locale of the UI: But I've found that const internationalizationVar = makeVar<InternationalizationVar>({
locale: getItemFromLS(LOCALE_LS_KEY) ?? LocaleEnum.en,
translations: {},
})
export const getItemFromLS = (key: string) => {
const data = typeof window !== 'undefined' ? localStorage.getItem(key) : ''
try {
return data === 'undefined' ? undefined : !!data ? JSON.parse(data) : data
} catch {
return data
}
} And there's no one ever calling The "change locale" feature is missing in the UI? |
Indeed, we do not allow to change the interface translations today. This is on our radar but have not been prioritised as of today. |
Can you work on this? I’ve translated the entire UI (3,000+ keys) to reduce adoption friction for our finance team. The easiest way to set the language for now is by opening the browser console and typing I also noticed that besides |
Hi @ansmonjol, I've implemented a suggestion on how we can implement this, it's fully functional: #2302 Please let me know what do you think. |
## Context Adding Brazilian Portuguese (pt_BR) translation. Related to getlago/lago-front#2283 --------- Co-authored-by: Alexandre Monjol <alexandre.monjol@gmail.com>
Context
Adding Brazilian Portuguese (pt_BR) translation.
Related to getlago/lago-api#3872