8000 GitHub - NikSativa/I18nKit: Simple and lightweight library that provides a convenient way to manage and use localized strings in iOS apps
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Sep 29, 2024. It is now read-only.
/ I18nKit Public archive

Simple and lightweight library that provides a convenient way to manage and use localized strings in iOS apps

License

Notifications You must be signed in to change notification settings

NikSativa/I18nKit

Repository files navigation

I18nKit

Important

No longer supported due to new String Catalogs in Xcode 15+

Simple and lightweight library that provides a convenient way to manage and use localized strings in iOS apps. Localization keys are represented as Swift enums, which makes it easier to manage and use them in the code.

Example

'I18nKeys.Auth.strings' file in main bundle:

"logIn" = "Log In";
"forgotPassword" = "Forgot your password?";
"selectCredentials" = "Select credentials";

'I18nKeys.Auth.swift' file app target:

extension I18nKeys {
    enum Auth: String, I18nKey {
        case logIn
        case forgotPassword
        case selectCredentials
    }
}

usage in the code:

let i18n: I18n<I18nKeys.Auth> = .init()
let logIn = i18n.t(.logIn)
ptint(logIn) // "Log In"

I18nKeysTester

Helper tool that allows you to test the existence of the localization keys in the project.

I18nKeysTester.test(TestI18n.self,
                    bundle: bundle,
                    fileName: "TestI18nCorrect",
                    options: .correct)

About

Simple and lightweight library that provides a convenient way to manage and use localized strings in iOS apps

Topics

Resources

License

Stars

Watchers

Forks

Languages

0