Skip to content

Commit

Permalink
rename gemspec to i18n-docs, update readme, add license
Browse files Browse the repository at this point in the history
  • Loading branch information
somebox committed Apr 20, 2012
1 parent 3f053e2 commit bdeed3c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 35 deletions.
8 changes: 8 additions & 0 deletions LICENSE.md
@@ -0,0 +1,8 @@
Copyright (c) 2012 Local.ch AG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

64 changes: 38 additions & 26 deletions README.md
@@ -1,14 +1,31 @@
# local.ch i18n helpers

GEM providing helper scripts to manage i18n translations.
# ![local.ch](http://www.local.ch/favicon.ico) local.ch i18n helpers

Features:
**i18n-docs** is a ruby gem that helps you to keep translations stored in Google Docs. This makes it easier for translators and project members to coordinate changes and updates. In addition, the standard features of Google Docs are super handy for this process: revision tracking, authorization, publishing, etc.

Although we at use it with Google Docs, it could be used with any CSV file.

## Features:

* check YAML files for missing translations
* export YAML files to CSV files for uploading them to Google Spreadsheet
* download translations from multiple Google spreadsheets and store to YAML files
* import/export YAML files with a Google Spreadsheet
* check YAML files for missing translations (`rake i18n:find_missing_keys`)

## Usage

Add the GEM to your Rails project:

gem 'i18n-docs'

The rake task `i18n:import_translations` requires following configuration file in `config/translations.yml`:

files:
naviagion.yml: "https://docs.google.com/spreadsheet/pub?key=ab43...34f3&single=true&gid=0&output=csv"
forms.yml: "https://docs.google.com/spreadsheet/pub?key=0Ap...XveWc&single=true&gid=0&output=csv"

This defines which translations files should be created by exporting a Google Spreadsheet. The content of the Spreadsheet URL is stored to a file called e.g. `example1.yml` within folders `config/locales/en` and all other detected locales.

## Rake Tasks
### Rake Tasks

Following Rake tasks are added by the GEM to your Rails project:

Expand All @@ -19,32 +36,23 @@ Following Rake tasks are added by the GEM to your Rails project:
* rake i18n:missing_keys
Find and list translation keys that do not exist in all locales

## Installation

Add the GEM to your Rails project:

gem 'localch-i18n', :git => 'git@github.com:local-ch/ws-localch-i18n.git'


The rake task `i18n:import_translations` requires following configuration file in `config/translations.yml`:

files:
example1.yml: "https://docs.google.com/spreadsheet/pub?key=0ApnemdIdiDXedGNrcTZoYnNqbjZQb09qeWpsX0JveWc&single=true&gid=0&output=csv"
example2.yml: "https://docs.google.com/spreadsheet/pub?key=0ApnemdIdiDXsfrtrcTZoYnNqbjZQb09qeWpsX0JveWc&single=true&gid=0&output=csv"
## Setup at Google Docs

It defines which translations files should be created by exporting a Google Spreadsheet. The content of the Spreadsheet URL is stored to a file called e.g. `example1.yml` within folders `config/locales/en` and all other detected locales.
* At Google Docs, create a new spreadsheet for your translations. The first column is the translation key, the other columns are the languages:
![screenshot](http://dl.dropbox.com/u/385855/Screenshots/bamr.png)
* use option `File -> Publish To the Web`
![screenshot](http://dl.dropbox.com/u/385855/Screenshots/2-lp.png)
* use **get a link** to generate a unique url that points to the CSV spreadsheet
![screenshot](http://dl.dropbox.com/u/385855/Screenshots/oom_.png)
* From now on you should only update translations in Google Docs and run `rake i18n:import_translations` in the application to get changes. You can also export your

## Usage

* First run `rake i18n:export_translations`. This will place current translations in the `tmp` folder of the application.
* Upload generated files to Google Docs
* In Google Docs, use option `File -> Publish To the Web` to make link to CSV spreadsheet you need for next step
* In `config` folder of the application, create `translations.yml` file with structure that is explained above in the installation section.
* Run `rake i18n:export_translations` to import translations from the Google Docs.
* From now on you should only update translations in Google Docs and run `rake i18n:import_translations` in the application to get changes.
## CHANGELOG

### 0.0.4

## CHANGELOG
Update docs, license. Push to Rubygems.org.

### 0.0.3

Expand All @@ -55,3 +63,7 @@ It defines which translations files should be created by exporting a Google Spre
* removed loading of `awesome_print` from the rake task. It was breaking
download

### Credits/License

This gem is sponsored by [local.ch](http://www.local.ch/). It is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). If you're a ruby developer and want to work with us in Switzerland, please check out our [jobs page](http://local-ch.github.com/).

8 changes: 0 additions & 8 deletions TODO.md

This file was deleted.

2 changes: 1 addition & 1 deletion localch-i18n.gemspec → i18n-docs.gemspec
Expand Up @@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.summary = "Maintain translations in Google Docs and export them to your Rails project."
s.description = "GEM providing helper scripts to manage i18n translations in Google Docs. Features: check YAML files for missing translations; export YAML files to CSV; download translations from multiple Google spreadsheets and store to YAML files"
s.authors = ["Georg Kunz", "Ivan Jovanovic", "Jeremy Seitz"]
s.email = 'georg.kunz@local.ch'
s.email = 'jeremy.seitz@local.ch'
s.files = `git ls-files`.split("\n")
s.homepage = 'https://github.com/local-ch/i18n-docs'

Expand Down

0 comments on commit bdeed3c

Please sign in to comment.