New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 814874 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Support $i18n{} in included elements (eg. from ui/webui/resources/)

Project Member Reported by steve...@chromium.org, Feb 22 2018

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.

 
Cc: hcarmona@chromium.org

Comment 2 by dpa...@chromium.org, 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?
Having a separate cr_components_strings.grd sounds reasonable to me. I'm not sure how involved setting that up would be.

Comment 4 by dpa...@chromium.org, 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