Placeholders for translations

25 views
Skip to first unread message

Jeffrey Kardatzke

unread,
Jan 7, 2021, 12:21:31 PM1/7/21
to Chromium-dev
Where is the list of placeholders for translations in Chrome? (i.e. things like USER or DOMAIN) I'm currently using the 'DOMAIN' placeholder which puts a full URL in a translated string such as https://www.google.com/, but I'd like it to just put the domain name instead.  I've searched but can't find the answer.

Thanks,

--
Jeffrey Kardatzke
Google, Inc.

Peter Kasting

unread,
Jan 7, 2021, 12:23:45 PM1/7/21
to Jeffrey Kardatzke, Chromium-dev
On Thu, Jan 7, 2021 at 9:18 AM 'Jeffrey Kardatzke' via Chromium-dev <chromi...@chromium.org> wrote:
Where is the list of placeholders for translations in Chrome? (i.e. things like USER or DOMAIN) I'm currently using the 'DOMAIN' placeholder which puts a full URL in a translated string such as https://www.google.com/, but I'd like it to just put the domain name instead.  I've searched but can't find the answer.

With most translated strings, we don't so much substitute based on a placeholder name, as make the placeholder name descriptive and simply make the code do the precise substitution expected.  So it's usually up to some block of C++ whether you're getting a full URL, a domain, or something else.

Can you share more details about your specific case?

PK

Jeffrey Kardatzke

unread,
Jan 7, 2021, 12:28:47 PM1/7/21
to Peter Kasting, Chromium-dev
Now that makes sense...I didn't even look at the code that was using the translation...easy to fix. :)

Reply all
Reply to author
Forward
0 new messages