Skip to content

Localize Editor Strings for Android #411

@jkmassel

Description

@jkmassel

For a future PR, we should likely localize strings like this in a manner similar to iOS.

public final class EditorLocalization {
/// This is designed to be overridden by the host app to provide translations.
public static var localize: (EditorLocalizableString) -> String = { key in
switch key {
case .showMore: "Show More"
case .showLess: "Show Less"
case .search: "Search"
case .insertBlock: "Insert Block"
case .failedToInsertMedia: "Failed to insert media"
case .patterns: "Patterns"
case .noPatternsFound: "No Patterns Found"
case .insertPattern: "Insert Pattern"
case .patternsCategoryUncategorized: "Uncategorized"
case .patternsCategoryAll: "All"
case .loadingEditor: "Loading Editor"
case .editorError: "Editor Error"
}
}
/// Convenience subscript for accessing localized strings.
public static subscript(key: EditorLocalizableString) -> String {
localize(key)
}
}

Originally posted by @dcalhoun in #326

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions