-
-
Notifications
You must be signed in to change notification settings - Fork 871
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
[ios] Change text "X objects" to "Y places, Z tracks" in Bookmarks and Tracks dialog #8245
base: master
Are you sure you want to change the base?
Conversation
ccc1a0c
to
4fc5120
Compare
@biodranik, hello and sorry for pushing, maybe you saw and forgot mentions in this thread. Could you please answer conversations above? |
Both my comments are not resolved, or am I missing something? |
b6ec65e
to
9dbb601
Compare
Hello, @biodranik, I resolved your threads. And my latest question was "What about using "(String(format: L("bookmarks_places"), bookmarksCount)), (String(format: L("tracks"), trackCount))" all the time? I mean no conditions." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! We usually split string regeneration commit into a separate one, to help with merge conflicts. Do you know how to amend commit and split it into two?
d56c272
to
914ce76
Compare
@biodranik, hello and pls check. |
Did you remove strings manually? There is a
|
ff2b1b2
to
ed60a67
Compare
@biodranik, done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience and contribution!
Дзякуй!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, sorry, I've somehow missed failed Android checks, there is one usage of the deleted string:
if (mEntity.size() == 0)
return getQuantified(resources, R.plurals.objects, 0);
We can make it better for the zero case (btw, it should also иу handled in the iOS code).
What about changing Android code to use bookmarks_empty_list_title
translation and add the same translation to iOS when there are 0 items?
@biodranik, hello. These are current situation in both platforms: Android:
iOS:
My proposal is |
@itfarrier I like it! |
Looks like it was a misunderstanding. The code should print: 0 bookmarks, 0 tracks |
54961fc
to
e0976b8
Compare
@biodranik, please, see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android/app/src/main/java/app/organicmaps/bookmarks/Holders.java
Outdated
Show resolved
Hide resolved
android/app/src/main/java/app/organicmaps/bookmarks/Holders.java
Outdated
Show resolved
Hide resolved
android/app/src/main/java/app/organicmaps/bookmarks/Holders.java
Outdated
Show resolved
Hide resolved
Note that Android correctly used the combining string |
bfb04f1
to
7199568
Compare
@biodranik, fixed. That was my bad, sorry. |
3bc6040
to
dde9435
Compare
@biodranik, could you please review? |
cb6ff87
to
15dca90
Compare
8d42649
to
405efcb
Compare
let bookmarks = String(format: L("bookmarks_places"), bookmarksCount) | ||
let tracks = String(format: L("tracks"), trackCount) | ||
|
||
if (bookmarksCount == 0 && trackCount == 0) || (bookmarksCount > 0 && trackCount > 0) { | ||
return "\(bookmarks), \(tracks)" | ||
} | ||
|
||
if (bookmarksCount > 0) { | ||
return bookmarks | ||
} | ||
|
||
return tracks | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let bookmarks = String(format: L("bookmarks_places"), bookmarksCount) | |
let tracks = String(format: L("tracks"), trackCount) | |
if (bookmarksCount == 0 && trackCount == 0) || (bookmarksCount > 0 && trackCount > 0) { | |
return "\(bookmarks), \(tracks)" | |
} | |
if (bookmarksCount > 0) { | |
return bookmarks | |
} | |
return tracks | |
if (bookmarksCount == 0 && trackCount == 0 || bookmarksCount > 0 && trackCount > 0) { | |
return String(format: L("comma_separated_pair"), | |
String(format: L("bookmarks_places"), bookmarksCount), | |
String(format: L("tracks"), trackCount)) | |
} | |
if (bookmarksCount > 0) { | |
return String(format: L("bookmarks_places"), bookmarksCount) | |
} | |
return String(format: L("tracks"), trackCount) |
@kirylkaveryn for some reason, singular forms are not printed with this code on iOS 15 simulator. Do you have any ideas why it doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirylkaveryn thanks for the hint. Looks like our Twine tool does not generate plurals from a generic language (en) into sublanguage (en-GB):
diff iphone/Maps/LocalizedStrings/en.lproj/Localizable.stringsdict iphone/Maps/LocalizedStrings/en-GB.lproj/Localizable.stringsdict
6c6
< * Language: en -->
---
> * Language: en-GB -->
22,23d21
< <key>one</key>
< <string>%d bookmark</string>
39,40d36
< <key>one</key>
< <string>%d file was found. You can see it after conversion.</string>
56,57d51
< <key>one</key>
< <string>%d track</string>
return getQuantified(resources, R.plurals.objects, 0); | ||
|
||
if (bookmarksCount > 0 && tracksCount > 0) | ||
if (bookmarksCount == 0 && tracksCount == 0 || bookmarksCount > 0 && tracksCount > 0) | ||
{ | ||
final String bookmarks = getQuantified(resources, R.plurals.places, bookmarksCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS uses bookmarks_places
string, it would be better to use it on Android too, and delete the places
string.
You also need to add this change and then regenerate strings with tools/unix/generate_localizations.sh [comma_separated_pair]
comment = A number of bookmarks and a number of tracks, separated by comma, like: 1 bookmark, 5 tracks
- tags = android
+ tags = android,ios
en = %@, %@ |
e12ea4b
to
50a7947
Compare
@itfarrier do you need any help with the PR? |
Hello. Not for now. I've just change the work and now too much loading on it, sorry. |
- Remove “objects” from strings.txt; - Add condition flow for Android; - Add condition flow for iOS. Fixes: organicmaps#8217 Signed-off-by: Dzmitry Padabed <itfarrier@icloud.com>
Signed-off-by: Alexander Borsuk <me@alex.bio>
@itfarrier no problem, I've finished the PR. @vng PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your hard work!
@@ -1,3 +1,4 @@ | |||
6aa73face8b5eb8e026cfafa40d1983d4a0502c0 | |||
480fa6c2fcf53be296504ac6ba8e6b3d70f92b42 | |||
a6ede2b1466f0c9d8a443600ef337ba6b5832e58 | |||
1377b81bf1cac72bb6da192da7fed6696d5d5281 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to have a cleaner git history for data/strings.txt
Fixes: #8217