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

refactor(common): simplify closure-locale by removing imports #18926

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

ocombe
Copy link
Contributor

@ocombe ocombe commented Aug 29, 2017

PR Type

What kind of change does this PR introduce?

[x] Refactoring (no functional changes, no api changes)

What is the current behavior?

The current closure locale contains too many imports which slows the build for g3

What is the new behavior?

We inlined all of the locales in the closure-locale file, and closure will remove all the unnecessary data at the end of the build.
We also only used the locales that closure uses instead of all of the locales available.

Does this PR introduce a breaking change?

[x] No

Other information

Do not merge this PR before #18907

@ocombe ocombe added area: i18n state: blocked target: major This PR is targeted for the next major release labels Aug 29, 2017
@ocombe ocombe requested a review from vicb August 29, 2017 12:47
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@mary-poppins
Copy link

You can preview a41365b at https://pr18926-a41365b.ngbuilds.io/.

const yargs = require('yargs').argv;
const {I18N_FOLDER, I18N_DATA_FOLDER, RELATIVE_I18N_DATA_FOLDER, HEADER} = require('./extract');
const OUTPUT_NAME = `closure-locale.ts`;

module.exports = (gulp, done) => {
let GOOG_LOCALES;
let GOOG_LOCALES = [
Copy link
Contributor

Choose a reason for hiding this comment

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

explain what this table is. Should be const ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's a "let" because it can be overwritten by cli arguments

'sk', 'sl', 'sq', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tl',
'tr', 'uk', 'ur', 'uz', 'vi', 'zh', 'zh-CN', 'zh-HK', 'zh-TW', 'zu'
];
const ALIASES = {
Copy link
Contributor

@vicb vicb Aug 29, 2017

Choose a reason for hiding this comment

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

explain what this table is.


l[0] = goog.LOCALE;
Copy link
Contributor

Choose a reason for hiding this comment

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

l might not be defined.
explain what you do with l[0] = goog.LOCALE

Copy link
Contributor

Choose a reason for hiding this comment

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

also seems like goog.LOCALE is not normalized ? (ie - vs _)


// to avoid duplicated "case" we regroup all locales in the same "case"
// the simplest way to do that is to have alias aliases
// e.g. 'no' --> 'nb', 'nb' --> 'no-NO'
Copy link
Contributor

Choose a reason for hiding this comment

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

don't see the loop that does that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only have one level of alias aliases, no need for a loop right now. We'll complicate the code later if necessary

@ocombe ocombe changed the title Closure locale all refactor(common): simplify closure-locale by removing imports Aug 29, 2017
@googlebot
Copy link

CLAs look good, thanks!

@mary-poppins
Copy link

You can preview 749dfbb at https://pr18926-749dfbb.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 456ecee at https://pr18926-456ecee.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 1366e34 at https://pr18926-1366e34.ngbuilds.io/.

@vicb vicb added action: merge The PR is ready for merge by the caretaker and removed state: blocked labels Aug 29, 2017
@vicb vicb merged commit 90bd984 into angular:master Aug 29, 2017
@ocombe ocombe deleted the closure-locale-all branch August 30, 2017 09:20
@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 12, 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 area: i18n cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants