Permalink
Browse files

Use JSON syntax in docs & Fix typo in manifest.js (#39)

Summary:
1. As for codeblock in `translating.md`, I think we should use json format as demonstration in `demo-app` uses filename 'translation_input.json`(Also added some missing commas).

2. Just small typo in `manifest.js`
Pull Request resolved: #39

Differential Revision: D13635756

fbshipit-source-id: c7f2f2fddc48eb3220f3d7631c59e4b890967877
  • Loading branch information...
ifndefdeadmau5 authored and facebook-github-bot committed Jan 11, 2019
1 parent 87aae58 commit fb8ef68001a326ab75d0215887b5c3f2c53e07c1
Showing with 9 additions and 9 deletions.
  1. +1 −1 demo-app/src/example/Example.react.js
  2. +7 −7 docs/translating.md
  3. +1 −1 transform/babel-plugin-fbt/bin/manifest.js
@@ -59,7 +59,7 @@ const LOCALES = Object.freeze({

type Locale = $Keys<typeof LOCALES>;
type Variation = $Values<typeof IntlVariations>;
type SharedObj = $Keys<typeof ExamplEnum>;
type SharedObj = $Keys<typeof ExampleEnum>;
type PronounGender = $Keys<typeof GenderConst>;

type Props = $ReadOnly<{||}>;
@@ -13,24 +13,24 @@ provided in our [GitHub demo
app](https://github.com/facebookincubator/fbt/blob/master/demo-app/translation_input.json)
is a good reference on the "schema" used for the translations.

```js
```json
{
phrases: [
"phrases": [
"hashToText": {
<text_hash>: <text>,
...
},
jsfbt: string|{t:<table>, m:<metadata>}
"jsfbt": string|{t:<table>, m:<metadata>}
],
...
translationGroups: [{
"fb-locale": "xx_XX"
"translationGroups": [{
"fb-locale": "xx_XX",
"translations": {
<translation_hash>: {
"tokens": [<token1>, ..., <tokenN>],
"types": [<variationType1>, ..., <variationTypeN>],
"types": [<variationType1>, ..., <variationTypeN>]
"translations": [{
"translation": <translation1>
"translation": <translation1>,
"variations": [variationValue1,...,variationValueN]
},
...,
@@ -43,7 +43,7 @@ const argv = optimist
'processing shared enums)',
)
.default('src-manifest', '.src_manifest.json')
.describe('src-manifest', 'The path or filename to write the source manfiest')
.describe('src-manifest', 'The path or filename to write the source manifest')
.argv;

if (argv.help) {

0 comments on commit fb8ef68

Please sign in to comment.