andresilvagomez / Localize

Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.
MIT License
291 stars 48 forks source link

Fallback language #35

Closed gustavoggs closed 6 years ago

gustavoggs commented 6 years ago

Is there a way to set the fallback languages if I want something different from what apple does?

gustavoggs commented 6 years ago

Example, I have this files: es-CO es-MX es en

If I do not have a string in es file, it is getting the string from es-CO, what is unexpected.

The problem looks to be in this part of the code:

        if bundle.path(forResource: tableName, ofType: "strings") != nil {
            let localized = bundle.localizedString(forKey: key, value: nil, table: tableName)

            if localized != key {
                return localized
            }
        }
andresilvagomez commented 6 years ago

@ggrana thanks for your contribution right now is working, I'll close this one !!!