https://github.com/materik/cocoapod-locally
Node package for going through your Xcode project, locating all localized strings
https://github.com/materik/cocoapod-locally
localization npm xcode
Last synced: 2 months ago
JSON representation
Node package for going through your Xcode project, locating all localized strings
- Host: GitHub
- URL: https://github.com/materik/cocoapod-locally
- Owner: materik
- Created: 2016-02-17T12:37:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-31T09:23:57.000Z (almost 10 years ago)
- Last Synced: 2025-03-29T05:12:38.798Z (about 1 year ago)
- Topics: localization, npm, xcode
- Language: JavaScript
- Homepage:
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

[](http://twitter.com/thematerik)
[](https://travis-ci.org/materik/locally)
Node package for going through your Xcode project, locating all localized
strings and add them to your `Localizable.strings` files. Also sorts and groups
the strings if they are new, in used or unused.
## Install
```
npm install -g materik/locally
```
## Usage
```
locally -i -o [-p ]
-i, --input
Filepath to the project where the recursive lookthrough
for localized strings should take place.
Supports multiple arguments.
-o, --output
Filepath to where the localized strings be saved, example:
'Resources/en.lproj/Localizable.strings'.
Supports multiple arguments.
-p, --pattern
How should the localized file be found, by default: 'NSLocalizedString(@?(), .*)',
where '()' will be picked out as the string.
Supports multiple arguments.
```
### Example
```
locally \
-i MyProject \
-o MyProject/en.lproj/Localizable.strings \
-o MyProject/sv.lproj/Localizable.strings \
-p "@().localize" \
-p "localize(@())"
```
### Ignore
You can choose for Locally to ignore some strings in both your
`Localizable.strings` file and in the project.
* Add `// locally ignore: lint` on the end of each line in your project that you want to ignore
* Add ignored strings under the section `/\* Ignored strings \*/` in your `Localizable.strings` file to have Locally skip them.
See `Demo` for an example of how to use it.
## Demo
Open the `Demo.xcodeproj`. Look into the `Localizable.strings` files and see the
`ViewController` class. Now, go to the root folder in the terminal and execute:
`npm run demo`. See how the `Localizable.strings` files changes with the runs.
## Test
There are multiple tests for the package. You can run them locally by executing:
`npm test`.
## Notes
- Will attempt to make this into a Xcode plugin.