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

External msg format #12

Merged
merged 3 commits into from
May 26, 2017
Merged

External msg format #12

merged 3 commits into from
May 26, 2017

Conversation

jbalsas
Copy link
Contributor

@jbalsas jbalsas commented May 25, 2017

Hey @eduardolundgren, @mthadley, this PR adds support for an externalMsgFormat option that can be used to replace the extracted messages by the soy compiler.

For example, for externalMsgFormat: "I18n.translate('$2').replace('a', 'A')" it would turn generated output like:

var MSG_EXTERNAL_1234123123123 = goog.getMsg('foo-bar');

into

var MSG_EXTERNAL_1234123123123 = I18n.translate('foo-bar').replace('a', 'A');

We are currently doing this via Gradle after all the compile steps have happened in https://github.com/liferay/liferay-portal/blob/master/modules/util/portal-tools-soy-builder/src/main/java/com/liferay/portal/tools/soy/builder/commands/ReplaceSoyTranslationCommand.java, but it would be nice if we could do it in just one step while we're compiling soy so we can also make sure changes in the compiler won't break client code.

What do you think?

Copy link

@mthadley mthadley left a comment

Choose a reason for hiding this comment

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

@jbalsas Makes sense to me!

@jbalsas jbalsas merged commit 7485736 into master May 26, 2017
@jbalsas jbalsas deleted the external_msg_format branch December 12, 2017 16:02
matuzalemsteles pushed a commit to matuzalemsteles/metal-tools-soy that referenced this pull request Aug 27, 2018
diegonvs pushed a commit to diegonvs/metal-tools-soy that referenced this pull request Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants