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

The v1.10.7 introduced a couple of breaking changes: Comparison vs v1.10.5 #104

Closed
davidpelayo opened this issue Dec 24, 2018 · 5 comments · May be fixed by yurovant/object-explorer#3
Closed

Comments

@davidpelayo
Copy link

davidpelayo commented Dec 24, 2018

I'm checking the differences of the v1.10.5 and v1.10.7 due I had translations using multiple placeholders that they were getting translated correctly before, and after upgrading they fail.

The comparison link, between those two versions, is the following: v1.10.5...v1.10.7.

So, were before this was correctly working:

computedProp() {
  const quantityClassName = this.$style[`${this.mainClassname}__quantity`];
  const translationParameters = {
    0: `<span id="${this.fromId}" class="${quantityClassName}">${from}</span>`,
    1: `<span id="${this.toId}" class="${quantityClassName}">${to}</span>`,
    2: `<span id="${this.totalId}" class="${quantityClassName}">${total}</span>`,
  };

  return this.$t(resultInfoKey, translationParameters);
}

With the version v1.10.7 returns the following
screen shot 2018-12-24 at 10 18 14 am

Not all placeholders found.

And I'm starting to suspect the root cause of this issue is at this line of code. Which actually relates to #98 and #99.

Please, any feedback or fix, is welcome.

@davidpelayo davidpelayo changed the title Comparing v1.10.5 vs v1.10.7 introduced a breaking change The v1.10.7 introduced a breaking change: Comparison vs v1.10.5 Dec 24, 2018
@tikiatua
Copy link
Member

HI @davidpelayo,

This issue is quite likely due to the changed regular expression match that we use to identify placeholders in translation strings. With the new regex matcher, we require at least two characters, which breaks your code if the variable replacement results in a matcher with only one character (i.e. a number).

I will adapt the regex matcher to also include matches for single characters as long as they match [A-Za-z0-9_]. Stay tuned.

@tikiatua
Copy link
Member

should be fixed in latest release v1.10.9

@davidpelayo
Copy link
Author

Additionally, to my message above, the latest version fails on IE11 due short hand properties not being transpiled, such us this.

Where:

SET_LOCALE(state, payload) {
}

It should be:

SET_LOCALE: function(state, payload) {
}

i18nerror

Is this intended?

@tikiatua
Copy link
Member

tikiatua commented Jan 2, 2019

Hi @davidpelayo

Thank you for reporting this. Definitely not intended. I will look into this.

@davidpelayo davidpelayo changed the title The v1.10.7 introduced a breaking change: Comparison vs v1.10.5 The v1.10.7 introduced a couple of breaking changes: Comparison vs v1.10.5 Jan 2, 2019
@tikiatua
Copy link
Member

tikiatua commented Jan 2, 2019

Hi there,

The issue should be fixed now in version v1.10.10. I needed to change the build process somewhat, as babel needs the node_modules and babelrc file to be in the same root directory as the scripts to transpile.

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 a pull request may close this issue.

2 participants