Conversation
|
There might be issues with places where Gulf of Mexico is said with the "Mexico" coming before the "Gulf of" part. I assume those exist, though I don't have an example with me. |
|
You´re right, I am gonna look into this and will update it accordingly. I also noticed a logic error in my code which will need to fixed. |
|
In French the base prefixe is also not the same between both, with "Golfe d'Amérique" and "Golfe du Mexique", due to the voyelle in Amérique. |
| }, | ||
| /* Add more languages here as needed */ |
There was a problem hiding this comment.
| }, | |
| /* Add more languages here as needed */ | |
| }, | |
| "fr": { | |
| base: "Golfe ", | |
| originalCountry: "d'Amérique", | |
| replacementCountry: "du Mexique" | |
| }, | |
| /* Add more languages here as needed */ |
this might work
| // \u200B is a zero-width space character. We add it to make the strings the same length | ||
| const REPLACEMENT_BYTES = [...mapping.replacementCountry + '\u200B'].map(char => char.charCodeAt(0)) |
There was a problem hiding this comment.
This assumes that the localized replacementCountry has exactly 6 letters, which is not always the case. A .repeat() thing might work?
There was a problem hiding this comment.
i also wonder: if replacementCountry.length > originalCountry.length, will this break the parsing, since the expected protobuf response layout will change cuz alignment will be thrown off?
This update enables replacements for languages beyond English. I've tested it with German, but you can expand support by adding more languages to langMappings. Additionally, I included the google.de domain in manifest.json to ensure functionality on the local domain.