Skip to content
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

Fix pt-BR missing translations #34

Open
MagelaCE opened this issue Feb 20, 2022 · 6 comments
Open

Fix pt-BR missing translations #34

MagelaCE opened this issue Feb 20, 2022 · 6 comments

Comments

@MagelaCE
Copy link

Here the JSON archive with update translations
pt-BR.zip
.

@spetzel2020
Copy link
Collaborator

spetzel2020 commented Feb 20, 2022 via email

@MagelaCE
Copy link
Author

Sorry, I sent the file from the compendium folder, disregard the message

@eduardopato41
Copy link

I did a slightly better translation (at the end of this post) but there's still a few strings that are not "translatable".

On the spell browser:
image

On the feature browser:
image
image

On the item browser:
image
image

On settings:
image

{
    "CMPBrowser.compendiumBrowser":"Navegador de Compêndio",
    "CMPBrowser.sortBy":"Classificar por",
    "CMPBrowser.cr":"Nivel de Desafio",
    "CMPBrowser.generalSettings":"Configurações Gerais",
    "CMPBrowser.allowSpellAcc":"Permite o acesso dos jogadores ao navegador de magias",
    "CMPBrowser.allowNpcAcc":"Permite o acesso dos jogadores ao navegador de NPCs",
    "CMPBrowser.compSettingsSpell":"Configuração de Compêndio de Itens",
    "CMPBrowser.compSettingsNpc":"Configuração de Compêndio de NPCs",
    "CMPBrowser.load":"Carregar",
    "CMPBrowser.lvl":"Nivel",
    "CMPBrowser.ritual":"Ritual",
    "CMPBrowser.concentration":"Concentração",
    "CMPBrowser.verbal":"Verbal",
    "CMPBrowser.somatic":"Somático",
    "CMPBrowser.material":"Material",
    "CMPBrowser.cantip":"Truque",
    "CMPBrowser.school":"Escola",
    "CMPBrowser.castingTime":"Custo de Ativação",
    "CMPBrowser.bonusAction":"Ação bonus",
    "CMPBrowser.reaction":"Reação",
    "CMPBrowser.spellType":"Tipo da Magia",
    "CMPBrowser.damageType":"Tipo de Dano",
    "CMPBrowser.class":"Classe",
	"CMPBrowser.artificer":"Artífice",
    "CMPBrowser.bard":"Bardo",
    "CMPBrowser.cleric":"Clérigo",
    "CMPBrowser.druid":"Druida",
    "CMPBrowser.paladin":"Paladino",
    "CMPBrowser.ranger":"Guardião",
    "CMPBrowser.sorcerer":"Feiticeiro",
    "CMPBrowser.warlock":"Bruxo",
    "CMPBrowser.wizard":"Mago",
    "CMPBrowser.general":"Geral",
    "CMPBrowser.components":"Componentes",
    "CMPBrowser.hasSpells":"Tem Magias",
    "CMPBrowser.hasLegAct":"Tem Ações Lendárias",
    "CMPBrowser.hasLegRes":"Tem Resistência Lendária",
    "CMPBrowser.creatureType":"Tipo de Criatura",
    "CMPBrowser.aberration": "Aberração",
    "CMPBrowser.beast": "Besta",
    "CMPBrowser.celestial": "Celestial",
    "CMPBrowser.construct": "Constructo",
    "CMPBrowser.dragon": "Dragão",
    "CMPBrowser.elemental": "Elemental",
    "CMPBrowser.fey": "Feérico",
    "CMPBrowser.fiend": "Ínfero",
    "CMPBrowser.giant": "Gigante",
    "CMPBrowser.humanoid": "Humanoide",
    "CMPBrowser.monstrosity": "Monstruosidade",
    "CMPBrowser.ooze": "Gosma",
    "CMPBrowser.plant": "Planta",
    "CMPBrowser.undead": "Morto-Vivo",
    "CMPBrowser.abilities": "Atributos",
    "CMPBrowser.dmgInteraction": "Interação do Dano",
    "CMPBrowser.dmgDealt": "Dano Causado",
    "CMPBrowser.size": "Tamanho",
    "CMPBrowser.Tab.SpellBrowser":"Navegador de Magias",
    "CMPBrowser.Tab.FeatBrowser": "Navegador de Características",
    "CMPBrowser.Tab.ItemBrowser": "Navegador de Itens",
    "CMPBrowser.Tab.NPCBrowser":"Navegador de NPC",
    "CMPBrowser.Tab.Settings":"Configurações",
    "CMPBrowser.SETTING.Maxload.NAME" : "Capacidade máxima",
    "CMPBrowser.SETTING.Maxload.HINT" : "Número máximo de magias, talentos, itens ou NPCs a serem exibidos; para ver mais use os filtros. Essa configuração é usada para gerenciar memória e capacidade do servidor.",
    "CMPBrowser.LOADING.Message" : "Carregando...{numLoaded} {itemType}s",
    "CMPBrowser.LOADED.Message": "{numLoaded} {itemType}s carregados(as)",
    "CMPBrowser.LOADED.MaxLoaded" : "(máximo exibido; para ver mais, use os filtros)",
    "CMPBrowser.Filters.ResetFilters" : "Redefinir Filtros"
}

@eduardopato41
Copy link

eduardopato41 commented Sep 23, 2022

I created a PR to fixed most of the missed translations on my post above. I'm not a dev but I did some tests and I don't think I broke anything. #45

But I have some questions:

  1. Every time I update this module, I have to change the cleanSpellName variable because by default it does not filter some spells in pt-br. I use something like this:
//original: let cleanSpellName = item.name.toLowerCase().replace(/[^一-龠ぁ-ゔァ-ヴーa-zA-Z0-9a-zA-Z0-9々〆〤]/g, '').replace("'", '').replace(/ /g, '');
let cleanSpellName = item.name.toLowerCase().replace(/\s/g, '').replace(/[àáâãäå]/g, "a").replace(/ç/g, "c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[òóôõö]/g,"o").replace(/[ùúûü]/g,"u").replace(/['/-:]/g, '').replace(/ /g, '');

Some spells that do not get filtered otherwise: "Bolha Ácida" or "Bênção". Is there a solution?

  1. On every update I overwrite the original "spell-classes.json", "item-packs.json" and "sub-classes.json" with a translated version I made. Is it possible to add them to the original one? Or too many spells names on the json could cause a problem? If it's ok, I could add them via PR as well.

Thanks! @spetzel2020 @joevaughan

@spetzel2020
Copy link
Collaborator

spetzel2020 commented Sep 23, 2022 via email

@eduardopato41
Copy link

I have a "spell-classes.json" file with 958 lines that includes spells in English and in Portuguese. I overwrite this file with the "original" that comes with the module. Here's the file in txt because github wont let me upload a json spell-classes.txt

For example, this is the same spell:

"bless": "cleric,paladin",
"bencao": "cleric,paladin",

Like I said, I'm not a dev I just dabble haha
My solution was to put everything in the same json.
Other than the generic solution you suggested maybe we could have a condition and create a different file for each language in a different folder? I don't know, but something like this:

if (language == pt-BR) {
this.classList = await fetch('modules/compendium-browser/spells-classes/pt-BR.json')
} else {
this.classList = await fetch('modules/compendium-browser/spells-classes/en.json')
}

But I don't know if you could detect the language used in Foundry. This could also solve the reformatting of the spell name (cleanSpellName).
And my bad, I can understand English just fine but I'm terrible writing and speaking it haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants