Closed Br3ndonn closed 2 months ago
Hey thanks for your contribution! Just a question, first time you open Cardo, it grabs the language from your locale, all I know is tauri retrieves a BCP-47 language tag (https://www.techonthenet.com/js/language_tags.php). Right now I'm grabing the first two letters before the dash "-". So there is one "en" for USA, Canada, England... One "es" for Spain, Mexico, Argentina... Do you think that's also correct for Portugal and Brazil? In that case I would save yor json as "pt". You can also check the locale the app retrieved from your OS in the config json. If you are on windows that file should be on C:\Users\%USERNAME%\AppData\Roaming\cardo\config.json
Although there are different expressions, verb tenses, pronouns between pt-br and pt-pt, general understanding will not be a problem.
This is my local config.json:
{ "globals": { "locale": "pt-BR", "language": "ptbr" },
Did you change "pt" to "ptbr" on language to test your json? This is the code that grabs the locale and gets the language, if the language don't extists on resources i18next uses english as default.
const setOSInfo = async () => {
const locale: string = await os.locale() || 'en-US'
settings.globals.locale = locale
settings.globals.language = locale.split('-')[0]
updateSettings(settings)
}
I think after merge I will set "pt" as language to let both brazilian and portuguese use your translations. Thanks!
Translation to brazilian portuguese