Comments (13)
Thanks for the info.
locize does only save the individual keys, not the original fil.
This is the reason all additional tags etc. are not there anymore.
Will investigate if there is something we can do for this.
from locize-cli.
I'm not super concerned about the XML comment tags, but I do use the <xliff:g>
placeholder tag to mark parts of the string so they're not translated.
Thanks for looking into this! I'm currently blocked by this, so if you have something in a beta I'd be happy to try it. I'm hitting a similar issue when I try to upload the string file to the site.
from locize-cli.
There is perhaps a chance to handle this like this:
<string name="star_rating">
Check out our 5
<xliff:g id="star">\u2605</xliff:g>
</string>
{
"star_rating": "Check out our 5\n <xliff:g id=\"star\">\\u2605</xliff:g>"
}
But it will just work if there is 1 xliff:g
in the sentence
Would this be ok for you?
from locize-cli.
If you like, you can try v7.1.3
from locize-cli.
Thanks for taking a swing at it. Unfortunately, I still can upload my strings.
I found another library that might help with the Android parsing and opened an issue with the suggestion. locize/android-string-resource#2
from locize-cli.
will have another investigation...
from locize-cli.
If you like, you can try v7.1.3
Looks like we're making progress. This part of the resource isn't getting preserved: <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
.
Also, all the string keys are changing which will be a problem when trying to use the translated versions with different keys.
- <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Example placeholder for a special unicode symbol -->
- <string name="star_rating">Check out our 5
- <xliff:g id="star">\u2605</xliff:g>
+ <?xml version="1.0" encoding="utf-8"?>
+ <resources>
+ <string name="app_homeurl.value">
+ Visit us at
+ <xliff:g id="application_homepage">http://my/app/home.html</xliff:g>
</string>
- <!-- Example placeholder for a for a URL -->
- <string name="app_homeurl">
- Visit us at <xliff:g
- id="application_homepage">http://my/app/home.html</xliff:g>
+ <string name="prod_name.value">
+ Learn more at
+ <xliff:g id="prod_gamegroup">Game Group</xliff:g>
</string>
- <!-- Example placeholder for a name -->
- <string name="prod_name">
- Learn more at <xliff:g id="prod_gamegroup">Game Group</xliff:g>
+ <string name="promo_message.value">
+ <![CDATA[Please use the "]]>
+ <xliff:g id="promotion_code">ABCDEFG</xliff:g>
</string>
- <!-- Example placeholder for a literal -->
- <string name="promo_message">
- Please use the "<xliff:g id="promotion_code">ABCDEFG</xliff:g>" to get a discount.
+ <string name="star_rating.value">
+ Check out our 5
+ <xliff:g id="star">\u2605</xliff:g>
</string>
- </resources>
+ </resources>
reformatting /private/tmp/android-docs.xml...
would have reformatted /private/tmp/android-docs.xml...
FINISHED
from locize-cli.
next try with v7.1.4
key order can't be preserved
from locize-cli.
We're getting closer!
The resource tag was still clobbered a bit.
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
became
<?xml version="1.0" encoding="utf-8" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"?>
<resources>
Also, all the string keys gain a .value
in their name.
from locize-cli.
xmlns:xliff is fixed now,
the .value was because of a bug in the format command
v7.1.5
from locize-cli.
This is much better!
The only nit I have is that the <xliff:g>
tags are moved to the start of their own line. I'm not 100% if that will cause a problem or not.
- <string name="app_homeurl">Visit us at <xliff:g id="application_homepage">http://my/app/home.html</xliff:g>
+ <string name="app_homeurl">Visit us at
+ <xliff:g id="application_homepage">http://my/app/home.html</xliff:g>
from locize-cli.
I think this will be ok... but I'm not an android expert ;-)
from locize-cli.
Thanks for fixing this issue!
from locize-cli.
Related Issues (20)
- Locize sync alters my `.json` files HOT 2
- Ambiguous --compare-modification-time flag behavior HOT 7
- version contains strange undeletable namespaces HOT 1
- Mapping between CLI params and config options HOT 1
- Locize sync results in FetchError HOT 5
- TypeError: Cannot read properties of null (reading 'value') HOT 1
- install.ps1 automatic figuring out of download url version has broken HOT 2
- bug(install): binary install not working HOT 15
- Not downloading all translations HOT 2
- The sync command crashes with Error: Callback was already called HOT 1
- The download command fails with an error when using the android format HOT 4
- vulnerabilities on npm install HOT 2
- `locize format` removes comments from `fluent files` HOT 1
- Fluent's `Message References` is not being saved in Locize. HOT 1
- High severity vulnerabilities on npm install HOT 1
- Locize-cli timeouts on sync HOT 4
- Support overwriting HOT 4
- https-proxy-agent dependency error on fresh install HOT 1
- Sync command doesn't do what documentation says HOT 4
- Download command misses newly added namespaces for tenant projects HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from locize-cli.