Closed mikhail-muzhev closed 5 years ago
Are the mentioned keys available in all translations? Seems that R.swift thinks they are missing.
Yes. R.swift thinks that .string and .stringdict are from different localisation.
It should definitely be possible to have different strings in a .strings
file and a .stringsdict
file. For example, we do this in the ResourceApp project in this repo.
Can you provide a stripped down example of this issue for us to reproduce?
.string
"ok" = "ok";
"error" = "Ошибка";
"notifications_forbidden_by_user" = "Notifications forbidden by user";
"skip" = "Пропустить";
"next" = "Далее";
"begin_work" = "Начать работу!";
"sec" = "сек";
"yes" = "Да";
"cancel" = "Отмена";
"unknown_error" = "Неизвестная ошибка";
"payment" = "Оплата";
"delete" = "Удалить";
.stringdict
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>documents</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>Документ%#@Variable@</string>
<key>Variable</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>zero</key>
<string>ов</string>
<key>one</key>
<string></string>
<key>two</key>
<string>а</string>
<key>few</key>
<string>а</string>
<key>many</key>
<string>ов</string>
<key>other</key>
<string>ов</string>
</dict>
</dict>
<key>instructions</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>Инструкци%#@VARIABLE@</string>
<key>VARIABLE</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>zero</key>
<string>й</string>
<key>one</key>
<string>я</string>
<key>two</key>
<string>и</string>
<key>few</key>
<string>и</string>
<key>many</key>
<string>й</string>
<key>other</key>
<string>и</string>
</dict>
</dict>
<key>questions</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>Вопрос%#@VARIABLE@</string>
<key>VARIABLE</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>zero</key>
<string>ов</string>
<key>one</key>
<string></string>
<key>two</key>
<string>а</string>
<key>few</key>
<string>а</string>
<key>many</key>
<string>ов</string>
<key>other</key>
<string>ов</string>
</dict>
</dict>
</dict>
</plist>
I copied your examples into Test.strings
and Test.stringsdict
files, and I'm not seeing any warnings.
Hm, that's really weird...
Shame on me... I've forgotten to click on localize
button after .stringdict-file creation
I'm using .string and .stringdict files for localisation. Everything works perfect, but I have two warnings:
As I understood, R.swift is generating localised strings from both of these files and it can't find ".string keys" inside ".stringdict" file, and ".stringdict keys" inside ".string" file. Of course there are different keys inside these files. So how could I resolve these warnings???