All Projects → freshOS → Localize

freshOS / Localize

Licence: mit
🏁 Automatically clean your Localizable.strings files

Programming Languages

swift
15916 projects
script
160 projects

Projects that are alternatives of or similar to Localize

Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (+41.48%)
Mutual labels:  translation, xcode
Swiftui Tutorials
A code example and translation project of SwiftUI. / 一个 SwiftUI 的示例、翻译的教程项目。
Stars: ✭ 1,992 (+540.51%)
Mutual labels:  translation, xcode
Bartycrouch
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
Stars: ✭ 1,032 (+231.83%)
Mutual labels:  translation, xcode
Assetchecker
👮Sanitize your Assets.xcassets files
Stars: ✭ 167 (-46.3%)
Mutual labels:  cleanup, xcode
Ioslocalizationeditor
Simple macOS editor app to help you manage iOS and macOS app localizations by allowing you to edit all the translations side by side
Stars: ✭ 1,066 (+242.77%)
Mutual labels:  translation, xcode
Fengniao
A command line tool for cleaning unused resources in Xcode.
Stars: ✭ 2,852 (+817.04%)
Mutual labels:  cleanup, xcode
Gotext
Go (Golang) GNU gettext utilities package
Stars: ✭ 292 (-6.11%)
Mutual labels:  translation
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+923.15%)
Mutual labels:  xcode
Imageloaderswift
A lightweight and fast image loader for iOS written in Swift.
Stars: ✭ 290 (-6.75%)
Mutual labels:  xcode
Bluepill
Bluepill is a reliable iOS testing tool that runs UI tests using multiple simulators on a single machine
Stars: ✭ 3,080 (+890.35%)
Mutual labels:  xcode
Xcproj
Command line tool for manipulating Xcode project files
Stars: ✭ 311 (+0%)
Mutual labels:  xcode
Ruby Hacking Guide.github.com
Ruby Hacking Guide Translation
Stars: ✭ 305 (-1.93%)
Mutual labels:  translation
Callbackurlkit
Implementation of x-callback-url (Inter app communication) in swift
Stars: ✭ 299 (-3.86%)
Mutual labels:  xcode
Lbry Desktop
A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
Stars: ✭ 3,597 (+1056.59%)
Mutual labels:  translation
Wordpress Ios
WordPress for iOS - Official repository
Stars: ✭ 3,239 (+941.48%)
Mutual labels:  xcode
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (-5.79%)
Mutual labels:  xcode
You Dont Know Js
📗📒 (PT-Br translation) JS Book Series.
Stars: ✭ 3,683 (+1084.24%)
Mutual labels:  translation
Js Lingui
🌍📖 A readable, automated, and optimized (5 kb) internationalization for JavaScript
Stars: ✭ 3,249 (+944.69%)
Mutual labels:  translation
Translators
🌏🌍🌎Translators🌎🌍🌏 is a library which aims to bring free, multiple, enjoyable translation to individuals and students in Python. Translators是一个旨在用Python为个人和学生带来免费、多样、愉快翻译的库。
Stars: ✭ 295 (-5.14%)
Mutual labels:  translation
Wipe Modules
🗑️ Easily remove the node_modules folder of non-active projects
Stars: ✭ 304 (-2.25%)
Mutual labels:  cleanup

Localize

Localize

Language: Swift Platform: iOS codebeat badge License: MIT Release version

Localize is a tiny run script that keeps your Localizable.strings files clean and emits warnings when something is suspicious.

Localize

Because Localization files tend to rot over time and become a hassle to work with. Stressful when you have to test your app against many different Localizations.

Try it!

Localize is part of freshOS iOS toolset. Try it out in the included example app!

How

By using a script running automatically, you have a safety net keeping them sane, checking for translation issues and preventing then to rot over time.

What

Automatically (On build)

  • [x] Cleans you localization files (removes spaces)
  • [x] Sorts keys Alphabetically
  • [x] Checks for Unused Keys
  • [x] Checks for Missing Keys
  • [x] Checks for Untranslated (which you can ignore with a flag)
  • [x] Checks for Redundant Keys
  • [x] Checks for Duplicate Keys

Installation

Add the following Run Script in your project's Build Phases in XCode, this will run the script at every build. Use the path of where you copied Localize.swift script.

${SRCROOT}/{REPLACE ME}} # e.g. ${SRCROOT}/Libs/Localize.swift

Run and Enjoy \o/

Configuration

Configure the top section of the Localize.swift according to your project.

More

Ignore [Potentially Untranslated] warnings

Just Add //ignore-same-translation-warning next to the translation. Example :

"PhotoKey" = "Photo"; //ignore-same-translation-warning

This will take care of ignoring [Potentially Untranslated] "XXX" in FR file doesn't seem to be localized

Unused false positive

Not found by the script reason 1

The script parses your project sources and checks if your keys are called within NSLocalizedString calls. But chances are you have a helper for a shorter NSLocalizedString syntax. This is indeed supported but you have to give the script what to look for.

You can modify the script to include other ways of localizations:

let patterns = [
    "NSLocalizedString\\(@?\"(\\w+)\"", // Swift and Objc Native
    "Localizations\\.((?:[A-Z]{1}[a-z]*[A-z]*)*(?:\\.[A-Z]{1}[a-z]*[A-z]*)*)", // Laurine Calls
    //Add your own matching regex here
    "fsLocalized\\(@?\"(\\w+)\""
]

Not found by the script reason 2

Another common pattern is to have keys being built at runtime. Of course those keys are not present at compile time so the script can't know about them and emits false positive errors. You can add those keys at the top of of the script to prevent this from happening:

let ignoredFromUnusedKeys = [
    "NotificationNoOne",
    "NotificationCommentPhoto",
    "NotificationCommentHisPhoto",
    "NotificationCommentHerPhoto"
]

Author

Sacha Durand Saint Omer, [email protected]

Contributors

JuliusBahr, ezisazis, michalsrutek

Contributing

Contributions to Localize are very welcomed and encouraged!

License

Localize is available under the MIT license. See LICENSE for more information.

Backers

Like the project? Offer coffee or support us with a monthly donation and help us continue our activities :)

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].