Don't add android localization strings into ios files and vice versa #1793
No reviewers
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#1793
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "pastk-strings-pyscripts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue #587
@ -63,3 +62,1 @@
"$TWINE" generate-all-localization-files --include translated --format android "$MERGED_FILE" "$OMIM_PATH/android/res/"
"$TWINE" generate-all-localization-files --format apple "$MERGED_FILE" "$OMIM_PATH/iphone/Maps/LocalizedStrings/"
"$TWINE" generate-all-localization-files --format apple-plural "$MERGED_FILE" "$OMIM_PATH/iphone/Maps/LocalizedStrings/"
"$TWINE" generate-all-localization-files --include translated --format android --untagged --tags android "$MERGED_FILE" "$OMIM_PATH/android/res/"
can't use twine validation still as it doesn't allow dots
.
in definition names (all our types use dots e.g. like[type.highway.footway]
@ -63,3 +62,1 @@
"$TWINE" generate-all-localization-files --include translated --format android "$MERGED_FILE" "$OMIM_PATH/android/res/"
"$TWINE" generate-all-localization-files --format apple "$MERGED_FILE" "$OMIM_PATH/iphone/Maps/LocalizedStrings/"
"$TWINE" generate-all-localization-files --format apple-plural "$MERGED_FILE" "$OMIM_PATH/iphone/Maps/LocalizedStrings/"
"$TWINE" generate-all-localization-files --include translated --format android --untagged --tags android "$MERGED_FILE" "$OMIM_PATH/android/res/"
Let's patch our twine fork :)
@ -63,3 +62,1 @@
"$TWINE" generate-all-localization-files --include translated --format android "$MERGED_FILE" "$OMIM_PATH/android/res/"
"$TWINE" generate-all-localization-files --format apple "$MERGED_FILE" "$OMIM_PATH/iphone/Maps/LocalizedStrings/"
"$TWINE" generate-all-localization-files --format apple-plural "$MERGED_FILE" "$OMIM_PATH/iphone/Maps/LocalizedStrings/"
"$TWINE" generate-all-localization-files --include translated --format android --untagged --tags android "$MERGED_FILE" "$OMIM_PATH/android/res/"
Ok, maybe I'll do it sometime. Its not really important as our
strings_utils.py
does a good validation job already.I've regenerated localizations, rebuilt and ran the android app, it crashed when I tapped search icon:
So some needed strings were removed..
I'll look into it.
What is not cool is that
data/hardcoded_categories.txt
is actually not used by the code, but the contents are duplicated insearch/displayed_categories.cpp
- it should be loaded from the file instead.The search works now. I haven't been able to crash the app so far :)
But given that android will crash if a string is not found (I guess iOS will not crash but display the key?) - its a risky update. I suggest we issue a beta with this change first.
Is it really necessary to remove a space?
@ -20,3 +20,3 @@
OMIM_ROOT = ""
CORE_RE = re.compile(r'GetLocalizedString\(\"(.*?)\"\)')
CORE_RE = re.compile(r'GetLocalizedString\("(.*?)"\)')
Use single quotes here and below for simlicity.
yes, twine fails to detect the
ios
tag in thetags = android, ios
string@ -20,3 +20,3 @@
OMIM_ROOT = ""
CORE_RE = re.compile(r'GetLocalizedString\(\"(.*?)\"\)')
CORE_RE = re.compile(r'GetLocalizedString\("(.*?)"\)')
We tried to avoid NSLocalizedString in favor of our own macro L
That problem was introduced by the author of the python script. The proper approach should be to delete data/hardcoded_categories.txt and to parse values from the cpp file.
So it was our scripts' fault that introduced this extra space?
yeap, without the space it works as expected
Hmm, I see.
Though having the categories not hardcoded, but in an editable resource file is overall a better approach, isn't it?
The ideal solution would be to load them from categories.txt directly (but some custom starting UI order should be also supported, which can change dynamically later when a user uses something more often).
But using a separate file, unsynced with the code, just for scripts, is definitely the wrong way.
Ok, we'll get to it sometime
#1795
So what do you think we should do with it?
If you'd rather not merge it now then I can remove the risky use of android tags in
generate_localizations.sh
from this PR for now so that we can merge the rest.Please insert todo here about reading from cpp file.
Done!
Merge. Test. Fix.
Ok, its ready to merge then.