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

[BUG] I18N TR in the middle of a value clobbers prefixed text #1648

Closed
AlbinoGeek opened this issue Sep 27, 2020 · 3 comments
Closed

[BUG] I18N TR in the middle of a value clobbers prefixed text #1648

AlbinoGeek opened this issue Sep 27, 2020 · 3 comments

Comments

@AlbinoGeek
Copy link

Summary

If you use the ability for I18N values to contain other calls to TR, where the call is in the middle of your value (such that plaintext is both before and after the call), the text before the call is clobbered by the value returned by the nested call to TR.

Versions, etc.

Thing Version
Golang 1.14.9 linux/amd64
Iris master 7cfcf9f
Kernel 5.8.10-200.fc32.x86_64
OS Fedora 32 Workstation

Reproduction

HTML

<label for="hostCiphertext">{{call .TR "message.HostResult"}}</label>

I18N File

[message]
Encrypted = Encrypted
Message = Message
EncryptedMessage = {{tr "message.Encrypted"}} {{tr "message.Message"}}
HostResult = Store {{tr "message.EncryptedMessage"}} Online

Results

Scenario Output
Actual EncrypEncrypted Message Online
Expected Store Encrypted Message Online
@AlbinoGeek AlbinoGeek changed the title [BUG] I18N Sub-TR in middle of value overwrites prefixed text [BUG] I18N TR in the middle of value clobbers prefixed text Sep 27, 2020
@AlbinoGeek AlbinoGeek changed the title [BUG] I18N TR in the middle of value clobbers prefixed text [BUG] I18N TR in the middle of a value clobbers prefixed text Sep 27, 2020
@kataras kataras added this to the v12.2.0 milestone Sep 28, 2020
@kataras
Copy link
Owner

kataras commented Sep 28, 2020

Hello @AlbinoGeek,

Thanks for the report but, this is already solved in my local version of i18n 🦾

image

The next commit of i18n package will introduce new and excited things, I didn't push it yet because need to make sure everything are working as epxected. Thanks for your patience 🙏

@AlbinoGeek
Copy link
Author

AlbinoGeek commented Sep 28, 2020

Of course! I can't wait for sections support in a better file format than .ini.

Right now, I am forced to write improper English, avoiding the use of the symbols: '"\;: which break .ini highlighting.

kataras added a commit that referenced this issue Sep 29, 2020
@kataras
Copy link
Owner

kataras commented Sep 29, 2020

Fixed, commit is live @AlbinoGeek 🥇

@kataras kataras closed this as completed Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants