Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Added uploadFunction, fixed issues #11

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ module.exports = function(grunt) {
transifex: {
"ios-ready": {
options: {
project: "rrportal",
targetDir: "./translations/ios-ready", // download specified resources / langs only
resources: ["localizable_enstrings"],
languages: ["en", "fr", "en_US"]
skipResources: ["unusedproperties"],
languages: ["en", "fr", "en_US"],
skipLanguages: ["en"],
useSlug: false // instead of using tx slug, try to use the orignal uploaded file for resource
}
},
"new-admintool": {
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# grunt-transifex

Provides a Grunt task that downloads translation strings from Transifex into your project using the [Transifex API](http://support.transifex.com/customer/portal/topics/440186-api/articles).
Provides a Grunt task that uploads new & existing source files to Transifex and downloads translation strings from Transifex into your project using the [Transifex API](http://support.transifex.com/customer/portal/topics/440186-api/articles).

This fork adds uploading and a couple of config options to the original grunt plugin by erasys
Uploading (transifex-upload):
* uploading of new files
* uploading/overwriting of existing files

Downloading (transifex):
* skipResources: if you want all expect a couple of resources
* skipLanguages: if the list of languages you don't want is shorter than the list you do want
* useSlug: The original plugin uses the slug for name, which loses capitalization. For example, if the uploaded files was uploadedFile.properties, the japanese download could be uploadedfile_ja.properties. Setting useSlug to false is able to spit out uploadedFile_ja.properties.

## Usage

Expand All @@ -10,9 +20,13 @@ Provides a Grunt task that downloads translation strings from Transifex into you
transifex: {
"ios-ready": {
options: {
project: "rrportal" // your transifect project
targetDir: "./translations/ios-ready", // download specified resources / langs only
resources: ["localizable_enstrings"],
skipResources: ["unusedproperties"], // useful for "all resources except these couple". In "slug" format
languages: ["en_US", "fr"],
skipLanguages: ["en"], // useful for "all languages but english"
useSlug: false, // instead of using tx slug, try to use the orignal uploaded file for resource
filename : "_resource_-_lang_.json",
templateFn: function(strings) { return ...; } // customize the output file format (see below)
}
Expand All @@ -37,7 +51,7 @@ This configuration enables running the `transifex` Grunt task on the command lin
'en_US' and 'fr'
grunt transifex:ios-ready:reviewed
--> Same as above, but downloads reviewed strings only

grunt transifex
--> Downloads reviewed & non-reviewed strings for all configured Transifex projects
grunt transifex::reviewed
Expand All @@ -56,7 +70,7 @@ Translated strings will saved into plain JSON if you use the default output conf
## Transifex credentials

When the plugin runs for the first time, it will prompt the user for a Transifex username and password.
It will store this information in a `.transifexrc` file created in the current directory.
It will store this information in a `.transifexrc` file created in the current directory.

On subsequent executions, the user won't be prompted again. Transifex credentials will be read from `.transifexrc`

Expand Down
Loading