Code Monkey home page Code Monkey logo

localize's Introduction

Try it!

Download our starter iOS Project and see how our tools fit together in a typical iOS App:
Download Starter Project

Our mission

FreshOS is on a mission to provide iOS developers with simple tools to solve problems that 99% of us have. We believe developers should focus on valuable things like app logic, rather than casting the values of a JSON Parsing \o/. We thrive to make apis as simple as possible, yet flexible enough to handle 99% of use-cases. We believe in Unix-style libraries, that do one thing and do it well. Since we have control over those tools, they fit together nicely.

Solutions

AutoLayout - Stevia ๐Ÿƒ Star

Write expressive autolayout code, readable and maintainable

Write concise networking code that leverages the power of Alamofire, promises and JSON Parsing

Make Async code delightful with Promises

Write minimalist JSON Parsing that infers type and doest get in the way of your models

Reduce Stress & Errors

Emit warnings and errors when Localizations are missing or unused

Emit warnings and errors when assets are missing or unused

Integrate Faster

Generate Swift code from Sketch designs

Who we are

<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script>
<script src="//cdn.jsdelivr.net/github-cards/latest/widget.js"></script> Let's not forget the 100+ people that contributed via pull requests, issues or even just talking to them :) This wouldn't be possible without them <3

Production ready

Our libraries have been Downloaded 175k+ times and already more than 3700+ Apps use freshOS tools!

Source : Cocoapods

Testimonials <3

Sketch to Swift is an amazing way to build quick prototypes. Always using to build small samples for my freelancing clients. Also using AssetChecker so I'm never messing up and breaking my code because I deleted or changed the name of an asset. I appreciate the work they put in freshOS and I'm glad AwesomeiOS has all of them
Lucas Farah - Admin @Awesome-iOS

Just want to say I love your different solutions. It's smart clean and easy to use.
Florent Douine - iOS Developer

Man I just wanted to tell you that Stevia, then, Arrow and ws is the most beautiful thing ever made! Really! This is beautiful!
Mauran Muthiah - Developer

This kind of libraries really is perfect. Very focused, obviously simple and useful, no magic, and small. They make development easier one step at a time.
Anonymous - HackerNews

Support/Contact

You can raise a github issue on the project you need support with or contact us at [email protected]

Hosting sponsored with ๐Ÿ’š by Muxu.Muxu

<script async defer src="https://buttons.github.io/buttons.js"></script>

localize's People

Contributors

albinekcom avatar ay8s avatar ezisazis avatar michalsrutek avatar nikkovios avatar s4cha avatar sionleroux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

localize's Issues

.localized pattern

It's often occurs, that developers use "key".localized pattern in swift. Does it support this pattern?

Add support for stringsdict

An enhancement tip.

Currently, the script only works with Localizable.strings.
It would be great to add support Localizable.stringsdict that help in plurals translations.

Would be great to support SwiftGen

Hey
we use SwiftGen in our code base and I would like to use Localize too.
I have created a patch that adds SwiftGen support and adds additional logging. Unfortunately I have no rights to create a PR, so I will paste below.
With best regards

Julius

diff --git a/Localize.swift b/Localize.swift
index 7f05cf6..de82525 100755
--- a/Localize.swift
+++ b/Localize.swift
@@ -26,7 +26,8 @@ let relativeSourceFolder = ""
  */
 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
+    "Localizations\\.((?:[A-Z]{1}[a-z]*[A-z]*)*(?:\\.[A-Z]{1}[a-z]*[A-z]*)*)", // Laurine Calls
+    "L10n.tr\\(key: \"(\\w+)\""// SwiftGen generation
 ]
 
 /*
@@ -64,8 +65,13 @@ let masterLanguage = "en"
 func listSupportedLanguages() -> [String] {
     var sl = [String]()
     let path = FileManager.default.currentDirectoryPath + relativeLocalizableFolders
+    if !FileManager.default.fileExists(atPath: path) {
+        print("Invalid configuration: \(path) does not exist.")
+        exit(1)
+    }
     let enumerator: FileManager.DirectoryEnumerator? = FileManager.default.enumerator(atPath: path)
     let extensionName = "lproj"
+    print("Found these languages:")
     while let element = enumerator?.nextObject() as? String {
         if element.hasSuffix(extensionName) {
:...skipping...
diff --git a/Localize.swift b/Localize.swift
index 7f05cf6..de82525 100755
--- a/Localize.swift
+++ b/Localize.swift
@@ -26,7 +26,8 @@ let relativeSourceFolder = ""
  */
 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
+    "Localizations\\.((?:[A-Z]{1}[a-z]*[A-z]*)*(?:\\.[A-Z]{1}[a-z]*[A-z]*)*)", // Laurine Calls
+    "L10n.tr\\(key: \"(\\w+)\""// SwiftGen generation
 ]
 
 /*
@@ -64,8 +65,13 @@ let masterLanguage = "en"
 func listSupportedLanguages() -> [String] {
     var sl = [String]()
     let path = FileManager.default.currentDirectoryPath + relativeLocalizableFolders
+    if !FileManager.default.fileExists(atPath: path) {
+        print("Invalid configuration: \(path) does not exist.")
+        exit(1)
+    }
     let enumerator: FileManager.DirectoryEnumerator? = FileManager.default.enumerator(atPath: path)
     let extensionName = "lproj"
+    print("Found these languages:")
     while let element = enumerator?.nextObject() as? String {
         if element.hasSuffix(extensionName) {
             print(element)

Example Project

Provide an example project in the repo to showcase the script abilities.

Struct Generation

Provide Optional Type-safe struct generation out of the box so that users don't need to rely on another third party tool.

  • Allow for custmization of the prefix ex : MyPrefix.Popup.Title

PhaseScriptExecution failed with a nonzero exit code

I use to use and love your lib, thank-you for the great work done. But, for a reason I cannot explain, I'm not able to build my projet anymore. The script failed.

I'm building the Localized example project and here is the error:

Command PhaseScriptExecution failed with a nonzero exit code

And some of the stack trace:

JIT session error: Symbols not found: [ _$s10Foundation12CharacterSetVMa, 
_$s10Foundation12CharacterSetV8newlinesACvgZ, 
_$sSy10FoundationE18trimmingCharacters2inSSAA12CharacterSetV_tF, 
_$sSS10FoundationE14contentsOfFile8encodingS2Sh_SSAAE8EncodingVtKcfC, 
_$sSS10FoundationE19_bridgeToObjectiveCSo8NSStringCyF,
 _$s10ObjectiveC8ObjCBoolVMn, 
_$sSy10FoundationE5write6toFile10atomically8encodingyqd___SbSSAAE8EncodingVtKSyRd__lF, 
_$s10Foundation22_convertNSErrorToErrorys0E0_pSo0C0CSgF, 
_$sSy10FoundationE20replacingOccurrences2of4with7options5rangeSSqd___qd_0_So22NSStringCompareOptionsVSnySS5IndexVGSgtSyRd__SyRd_0_r0_lF, 
...

It may not be directly linked to freshOS/Localize but maybe you have some hint ?

Script contains multiple redeclaration cases

Localize.swift contains multiple redeclaration cases of some variables like sanitizeFiles or singleLanguage.

All these errors can be seen on the attached screenshot.

On the other hand the version of Localize.swift that is provided in the Starter Project compiles and does not contain any redeclaration cases. Although this version of the script looks older and outdated.

Can you please provide some more info why this is the case and how should the script be fixed into a working state.

screen shot 2018-05-31 at 16 31 02

SwiftLint integration

Hi, nice tool !

More and more project are using SwiftLint which is very powerful and have some nice integrations like fastlane. Could this be easily integrated into Swiftlint or as a plugin or something like this ?

Unable to find some of the usages

The script can't find those usages where (let's say, the line is too long) a key is broke into a new line

NSLocalizedString(
@"string_key", nil)]

Can be easily fixed by doing:

NSLocalizedString(@"string_key", nil)]

Although it would be nice if the script could find the first one too

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.