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

[mat-icon] preventing content from translation #14889

Merged
merged 6 commits into from
Feb 7, 2019
Merged

[mat-icon] preventing content from translation #14889

merged 6 commits into from
Feb 7, 2019

Conversation

pavel-agarkov
Copy link
Contributor

Current behavior:

before translation after translation
image image

to prevent mat-icon content from translation by automated tools I'm adding notranslate class to mat-icon by default.

PS: I think it makes sense to use this class all the time and not only for font icons since even for svg icons there are only the following use cases:

  1. There is no text inside svg icon - so class will do no harm
  2. There is some text (e.g. one big letter as an icon) and it most likely shouldn't be translated
  3. It is highly unlikely to have a long text inside svg icon and to want it to be translated

This why I decided to have less conditions and add class to all icons by default.

From Google Translate FAQ:
image

adding notranslate class to mat-icon to prevent its content from translation by automated tools
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 19, 2019
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test specifically for notranslate?

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed labels Jan 19, 2019
@crisbeto
Copy link
Member

Caretaker note: commit message to be changed to fix(icon): prevent content from being translated.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn merged commit b10dd04 into angular:master Feb 7, 2019
jelbourn pushed a commit that referenced this pull request Feb 11, 2019
Prevents translation services (like Google Translate) from translating icon ligatures used in mat-icon.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: fix commit message When the PR is merged, rewrites/fixups of the commit messages are needed target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants