Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
u9520107 committed Jan 2, 2018
1 parent 8bcf006 commit 4b37de7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default {
[constants.fetchError]: 'Fetch Error',
icuCompliant: 'Greetings, {name}!',
handleEscapedBraces: 'Escape braces with single quote: \'{foo}\'',
'complex-keys': 'Support using quoted property names',
};
```

Expand Down Expand Up @@ -92,3 +93,32 @@ gulp.src('./src')
.pipe(babel(...babelConfig))
.pipe(gulp.dest('./build'));
```

Export to Xlf
---

The exportLocale function can be used to generate xlf files.

```javascript
import ExportLocale from 'locale-loader/exportLocale';

const config = {
sourceLocale: 'en-US', // the default locale with original strings
supportedLocales: ['en-US', 'fr-FR', 'ja-JP'], // the array of locales to support
sourceFolder: 'src', // export locale will use 'src/**/*.js' glob to search for loaders
localizationFolder: 'localization', // exported files will be saved to here
exportType: 'diff', // determines what is exported
};

exportLocale(config).then(() => {
console.log('.xlf generated to `cwd()/localization/`');
});

```

**Export Types**

1. 'diff': Diff will only export entries that have not been translated, or have been modified since last translation. This is the default mode.
2. 'full': This will export everything.
3. 'translated': This will only export translated entries.

0 comments on commit 4b37de7

Please sign in to comment.