Support $i18n{} in included elements (eg. from ui/webui/resources/) |
|
Issue description
Currently the $i18n{} macro does not work in included Polymer elements, e.g.
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_nameservers.html">
Instead we need to include I18nBehavior in the included element and use [[i18n('foo')]] in the element's html file.
We need to investigate and document how to set this up properly and fix any issues blocking this.
,
Feb 22 2018
Trivia For the pages that do respect optimize_webui=true/false, I am guessing that this is only a problem in the "false" case, since the chrome://resources/cr_components/* URL is not actually fetched at runtime whet optimize_webui=true, and those components are bundled under a different URL (chrome://settings/ for example). Problem? Basically it seems to me that serving chrome://resources/cr_components/ URLs does not invoke the C++ template replacements, because at the time the file is loaded from disk, we don't know which strings to include. Suggestion Would it make sense to create a cr_components_strings.grd, and move all strings used by those components there? Then swap those strings in C++ when this file is loaded?
,
Feb 22 2018
Having a separate cr_components_strings.grd sounds reasonable to me. I'm not sure how involved setting that up would be.
,
Feb 22 2018
I am also wondering for the optimize_webui=true case. Hopefully we would be able to leverage cr_components_strings.grd for both true and false, as opposed to including them separately (settings_strings.grdp)? |
|
►
Sign in to add a comment |
|
Comment 1 by steve...@chromium.org
, Feb 22 2018