Closed Jeehut closed 2 years ago
@Jeehut : Does it also work with xib files?
@Angelk90 Yes, it works with XIB files, too. BartyCrouch actually extracts and incrementally updates the localized strings from them. That's why I had initially created the tool in the first place, because adding new keys was really tedious, especially with many languages supported.
Closing issue for now till we add support back for localisation.
@nanashili @lukepistrol You seem to have decided that localization will happen at a later stage, which I can totally understand. Do you have any details on when localization would be added? I have some expertise here (I am currently even writing an app to simplify localization) and I can not find a thread where this decision was made with additional details. Do you plan to add it before 1.0 release or after, for example?
Problem: The localization story of this project seems to be unclear. I found this String extension which is supposed to be used to get autocompletion by adding all keys into the
LocalizedStringKey
extension in the same file. But none were added yet except the first sample "Hello World" entry.Still, in some places I see calls into
localized()
, even in places where you could simply pass a plain String literal because theLocalizedStringKey
type is alreadyStringLiteralConvertible
, thus nolocalized()
call is needed to localize it.At the same time, in some places there's no
localized()
call and in some places there's not even a translation key inside theLocalizable.strings
file. This problem will get larger and larger over time with more and more keys added. Later, with more languages, it will also be hard to keep up with translations.Additionally, the current
localized()
approach does not support Stringsdict files.Solution: I suggest we use the popular tool SwiftGen instead of the
.localized()
approach or plainLocalizedStringKey
from SwiftUI, which has the following advantages:L10n.
enum prefix).Additionally, I suggest we use the tool BartyCrouch (full disclosure: it's written by me) to further prevent letting translation issues creep into the project over time by using it's linting functionalities, such as:
BartyCrouch also greatly simplifies adding new keys to many language files in one go (read this blog post where I explain it in more detail).
The installation of SwiftGen and BartyCrouch should be also documented in the
CONTRIBUTING.md
file.I would be up to set this all up myself as I have some expertise here, but of course only if this is a wanted path.