Closed xabirequejo closed 1 year ago
I looked up the Localizable.strings file and it seems that the entire line is missing for both. Doesn't look like a typo issue to me.
You need to add it there.
Hmmokay. I must've dropped them at some point; I'm sure they where showing the other day. I have added them back to where they were before, I believe. I'm going to take a look at plurals. Sorry and thanks.
Hi again,
X secs/mins/hours ago
. Is it possible to edit it somehow so that the word order is different depending on the number ("one" or "other")?n$
between the format specifier like %1$lld
.
%lld posts from %lld people
== %1$lld posts from %2$lld people
== %2$lld people wrote %1$lld posts
"design.tag.n-posts-from-n-participants %lld %lld" = "%2$lld명의 사용자가 %1$lld개 글 작성함";
DateFormatter()
and RelativeDateFormatter()
handle them. So I believe they are not part of string translations.Hope this helps!
Thank you, I'm not sure how to use it, though. Would this be ok if the goal was to change the order to %2$lld people wrote %1$lld posts
(instead of %lld posts from %lld people
?
<key>design.tag.n-posts-from-n-participants %1$lld %2$lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@tagParticipantsCount@ %#@tagPostsCount@</string>
<key>tagParticipantsCount</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>Partaide batek egindako</string>
<key>other</key>
<string>%2$lld partaidek egindako</string>
</dict>
<key>tagPostsCount</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>bidalketa %lld</string>
<key>other</key>
<string>%1$lld bidalketa</string>
</dict>
</dict>
Can I modify the main <key>
or does that need to be as is?
—
And about the last two bullet points on the previous post, I was wondering about the source of the time/date that is shown on posts as it's not correct in Basque. I thought that maybe I could have a look at it.
@xabirequejo
The main key should remain the same. If you want to change the order, you should modify the NSStringLocalizedFormatKey
value.
<dict>
<key>design.tag.n-posts-from-n-participants %lld %lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@tagPostsCount@ written by %#@tagParticipantsCount@</string>
<key>tagPostsCount</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>%lld post</string>
<key>other</key>
<string>%lld posts</string>
</dict>
<key>tagParticipantsCount</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>%lld person</string>
<key>other</key>
<string>%lld people</string>
</dict>
</dict>
</dict>
</plist>
Take a look at this line from the actual code and let's assume that tag.totalUses
is 4 and tag.totalAccounts
is 1.
The stringsdict above should say 4 posts written by 1 person
.
<dict>
<key>design.tag.n-posts-from-n-participants %lld %lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%2$#@tagParticipantsCount@ wrote %1$#@tagPostsCount@</string>
<key>tagPostsCount</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>%lld post</string>
<key>other</key>
<string>%lld posts</string>
</dict>
<key>tagParticipantsCount</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>%lld person</string>
<key>other</key>
<string>%lld people</string>
</dict>
</dict>
</dict>
</plist>
In the same situation, this stringsdict will say 1 person wrote 4 posts
.
The n$
position specifier represents that it will grab the n
th variable from the code.
In the case of the date & time formatting, I believe there's nothing we can do about it only with string localizations for now.
Hey, @te6-in: Thank you very much for your help. Now Basque localisation makes a lot more sense with the new order. Thanks
I'm glad it was helpful 😄 I learned a lot of new things too.
Environment:
Description
String
account.detail.n-fields %lld
doesn't seem to use localisation on 1.4.6. It shows the string itself, not the text. Same issue withaccount.detail.featured-tags-n-posts
. The app shows the right text when the language is changed to British English or Catalan.Related Issues
Very similar to #525: account.followers is not translated to Catalan
Illustration