Open Heenawter opened 4 months ago
Pinging @elastic/kibana-core (Team:Core)
I found the reason for the missing translations:
Our message extractor checks for the explicit patterns i18n('a.message')
or i18n.translate('a.message')
(relevant code).
Any places renaming i18n
to something else are not caught by our script 🙈 .
Using the regexes \s(?!i18n\.translate)\w+\.translate\(
and import { i18n as
I found all these occurrences (there might be more, though):
package/core/overlays
:
src/plugins/management
:
x-pack/packages/kbn-elastic-assistant
:
x-pack/observability_solution/synthetics
:
x-pack/observability_solution/uptime
:
x-pack/plugins/security_solution
:
x-pack/plugins/transform
:
As a quick fix, we could revisit all those usages to follow the expected pattern. But we need to find a way to fix the script.
cc @Bamieh
Describe the bug: Despite existing in the Kibana codebase for 4 years, the following translations are missing:
core.overlays.confirm.cancelButton
core.overlays.confirm.okButton
This is causing a bug in Dashboard (and anywhere where the overlay service's
openConfirm
is used) where, if a manual translation is not provided, the buttons are not translated:(In the above screenshot, custom
Confirm
text was provided but customCancel
text was not). Considering how long ago this code was added, I'm assuming these translations somehow fell through the cracks.Steps to reproduce:
'zh-CN'
inkibana.yml
and launch KibanaCancel
button is not being translated despite being passed through thei18n
service with the following key:core.overlays.confirm.cancelButton
Expected behavior: Both the
Cancel
andConfirm
buttons should be translated without the consumer ofopenConfirm
having to provide them - they should only need to provide them if they want custom textMore screenshots:
When deleting a dataview: