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

i18n test locale not translating everything #62921

Closed
flash1293 opened this issue Apr 8, 2020 · 12 comments
Closed

i18n test locale not translating everything #62921

flash1293 opened this issue Apr 8, 2020 · 12 comments
Labels
bug Fixes for quality problems that affect the customer experience impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Project:i18n Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@flash1293
Copy link
Contributor

flash1293 commented Apr 8, 2020

Some phrases in the Kibana are not translated properly using the en-xa test locale. I didn't find a pattern yet what causes this, all places I've found seem to use i18n.translate or FormattedMessage properly:

Screenshot 2020-04-08 at 11 14 56

Screenshot 2020-04-08 at 11 16 13

Screenshot 2020-04-08 at 11 17 38

@flash1293 flash1293 added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Project:i18n labels Apr 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

pgayvallet commented Apr 9, 2020

I did not know about this en-xa locale, however from a quick grep I think this is an expected behavior of this locale?

const PSEUDO_ACCENTS_LOCALE = 'en-xa';
export function isPseudoLocale(locale: string) {
return locale.toLowerCase() === PSEUDO_ACCENTS_LOCALE;
}
/**
* Replaces every latin char by pseudo char and repeats every third char twice.
*/
function replacer() {
let count = 0;
return (match: string) => {
// if `match.length !== 1`, then `match` is html tag or markdown link address, so it should be ignored
if (match.length !== 1) {
return match;
}
const pseudoChar = pseudoAccentCharMap[match] || match;
return ++count % 3 === 0 ? pseudoChar.repeat(2) : pseudoChar;
};
}

Or is the issue here that every message should be displayed with this en-xa locale and are not?

@flash1293
Copy link
Contributor Author

Exactly, from my understanding every message should be displayed with this locale. Platform is probably the wrong team. @Bamieh do you know who to ping?

@pgayvallet
Copy link
Contributor

Platform is probably the wrong team

I see /src/legacy/server/i18n/ @elastic/kibana-platform in CODEOWNERS, so maybe we are the good one. @joshdover are we officially in charge of packages/kbn-i18n ?

@joshdover
Copy link
Contributor

No I think that is just outdated from before localization was split out from the Platform team. @Bamieh should be able to help us out here, and I think we should reassign the code owners to @elastic/pulse

@joshdover joshdover added Team:Pulse and removed Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Apr 9, 2020
@Bamieh Bamieh added bug Fixes for quality problems that affect the customer experience Team:Localization labels Apr 13, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-localization (Team:Localization)

@Bamieh
Copy link
Member

Bamieh commented Apr 13, 2020

We do have a localization team on github so i think it should go there @elastic/kibana-localization. (Here is a pr to update the file #63354)

All i18n messages should be translated using the en-xa to the psuedo locale. So I believe this is a bug. I'll try to have this prioratized to investigate further.

@afharo afharo removed the Team:Pulse label Apr 14, 2020
@joshdover
Copy link
Contributor

@Bamieh friendly bump on this one. We have at least one customer who is using the en-xa locale to find strings in the UI that are translatable so that they can provide custom translations for their needed locales. With this feature sort of broken, they're having a harder time determining which strings they can translate. I have pointed them to the i18n_extract tool as a stop-gap, but I think this feature is also helpful.

@Bamieh
Copy link
Member

Bamieh commented Sep 14, 2020

Our recommended process to creating custom translation is the following:

  1. Extract labels into the en.json file in a custom plugin like this:
    node scripts/i18n_extract --output-dir .\plugins\<custom-plugin>\translations --output-format json

  2. Copy the file under the <locale>.json name in the same folder.

  3. Apply the translations to the locale file.

  4. Update the .i18nrc.json file in custom plugin root to include the translations file path.

  5. Verify the file like this:
    node .\scripts\i18n_check.js --fix --include-config .\plugins\<custom-plugin>\.i18nrc.json

The en-xa is used to verify that we have all of our kibana strings internationalized. We are depending less on it internally by improving our checker and tests.

@lukeelmers lukeelmers added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Oct 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Nov 4, 2021
@pgayvallet
Copy link
Contributor

@Bamieh do you know if that can be closed by the i18n lib bump initiative you've been working on?

@Bamieh
Copy link
Member

Bamieh commented Jul 23, 2024

Context was not propograting correctly in the previous react-intl package and we did not have any code to detect unreachable code. Now i18n throws an error during development if this happens (even in test cases).

So this should be resolved, if we find new issues around we can open a new issue.

We do not have en-xa at the moment since the implementaiton changed after the upgrade and this would need to be introduced again as a feature if we have people requesting it (developers or translators).

@Bamieh Bamieh closed this as completed Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Project:i18n Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

7 participants