Skip to content

Commit fb2980e

Browse files
authored
Update README.md
update readme on translations
1 parent 9dc3aed commit fb2980e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,26 @@ handleCustomSubmit = () => {
117117
New languages support can be added or replace the existing ones
118118
[Existing translations](./src/translations/TranslatedText.tsx#defaultMessages)
119119

120+
121+
[![Edit react-quizzesExample RU locale](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-quizzesexample-ru-locale-wx50m?fontsize=14&hidenavigation=1&theme=dark)
122+
120123
```javascript
121124
import { QuizzBuilder } from "react-quizzes"
122-
import { defaultMessages } from "react-quizzes/translations/TranslatedText";
125+
import { defaultMessages } from "react-quizzes/lib/translations/TranslatedText";
123126

124127
// existing keys can be found on above link
125-
defaultMessages["pt-PT"]={
126-
"toolbox.textinput.name": "Text Input",
127-
"confirm.action": "Are you sure?",
128-
"btn.yes": "Yes",
129-
"btn.no": "No",
130-
"btn.add": "Add",
128+
defaultMessages["pt"]={
129+
"toolbox.textinput.name": "Caixa de Texto",
130+
"confirm.action": "Tem a certeza?",
131+
"btn.yes": "Sim",
132+
"btn.no": "Não",
133+
"btn.add": "Adicionar",
131134
...
132135
}
133136
function App() {
134137
return <QuizzBuilder
135138
onChange={(form) => console.log(form)}
136-
language="pt-PT"
139+
language="pt"
137140
messages={toolBoxItems}
138141
/>
139142
}

0 commit comments

Comments
 (0)