Comments (6)
Originally posted by David Farning:
After looking into this more deeply it looks like the orginal .properties author
escaped colons. Thus : becomes \:
I don’t know enough about the code base to make a patch but my orginal guess
involves making a change in misc/quotes.py.
Should lines 176 and 182 add the ability to handle :
-dtf
from translate.
The trouble here is that : doesn’t need to be quoted in a properties file or in
a .po file. So our choices are:
1) Drop the \ in front of the :
Then in the PO file we have a nice simple :
The problem is that we will not regenerate the \ in the properties file
Whether this is a problem or not is debatable, since it sholdn’t be there in the
first place…
2) Include a single \ in the PO file, and keep it when converting back.
This would be fairly confusing as PO files don’t usually escape : and a \ in a
PO file should be escaped
3) Include a double \ in the PO file, and keep that double backslash when
converting back.
This is the current situation which leads us to a double backslash in the
.properties file
4) Include a double \ in the PO file, and convert it back to a single backslash
in the .properties file
The trouble with this is that it is inconsistent with backslash escaping of \n
etc…
We’d need to evaluate the above 4 options before deciding what to do.
from translate.
Originally posted by David Farning:
I was looking through the translations this morning and noticed that some
translators like to escape colons, equal-signs, and semi-colons. I googling to
try to determine if there is a reason in any language for escaping those characters.
If there is no reason for escaping those characters in the first place, the best
bet would seem to be to ask tranlators not to escape them. Otherwise we run the
risk of turning a bug into a feature.
from translate.
Originally posted by David Farning:
The colons and equal-signs are escaped in mozilla .properties files in order to
meet the specifications of java .properties files. The Java spec is at
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html
This bug is strongly correlated with http://bugs.wordforge.org/show_bug.cgi?id=12
This would indicate that a perferred solution would be to drop the / on colons
and equals-signs when transforming to .po and stick the / back on whenever
rebuilding a .properties file.
from translate.
Re comment 4:
I think you want to s#/## there…
At the moment adding the \ in before all colons would probably cause a lot more
changes than the ones its trying to fix, so I’m not keen on that unless Mozilla
does decide to make it a standard, in which case it could be don eafter 1.5
from translate.
Mozilla .properties don’t correctly follow the Java properties spec. So until
they do we’ll be running a rat race to catch corner cases. Thus closing this as
WONTFIX
from translate.
Related Issues (20)
- po2rc should preserve comments location
- test_odf_xliff changes working directory and does not change it back, breaking other tests
- Unable to make tests pass locally - pycountry triggers DeprecationWarning with pkg_resources HOT 3
- translate-toolkit-3.9.2-1.fc39.x86_64/usr/bin/mozfunny2prop --manpage hangs HOT 4
- Extract only text from IDML by idml2po
- support several input parameters for pofilter (and other commands)
- Support for Android resource converter HOT 4
- prop2po: support for different encodings for both the input file and the template
- prop2po: personality given in command line is ignored for .strings files HOT 2
- Locate tests and test data outside 'translate' module HOT 2
- Ben
- Android: Some strings marked as `translatable="false"` still treated as translatable HOT 2
- Code block not parsed from Markdown HOT 3
- Proposal to use mdit-py-i18n (along with markdown-it-py) for Markdown support HOT 7
- Reduce question mark escaping in Android
- tests/translate/convert/test_rc2po.py failures with Python 3.12 HOT 7
- Translate
- Use Windows newlines for resx files
- Do not include "Explanation" field in iOS strings files HOT 2
- Add support for Mobile Kotlin resources 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 translate.