Skip to content

Commit

Permalink
Reproducible example #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmso committed Oct 8, 2020
0 parents commit 5a550dd
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
node_modules
dist
*.log
.DS_Store
coverage

14 changes: 14 additions & 0 deletions de_DE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"headers": {
"plural-forms": "nplurals=2; plural=(n != 1);",
"language": "de"
},
"contexts": {
"Title": {
"Delete ${ name }": [
"${ name } löschen",
"${ count } Kontakte löschen"
]
}
}
}
23 changes: 23 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const {
c,
msgid,
addLocale,
useLocale
} = require('ttag');

const translationObj = require(`./de_DE.json`);

const locale = 'de_DE';

addLocale(locale, translationObj);
useLocale(locale);

const error1 = () => {
const name = 'John Doe';
const count = 2;
const result = c('Title').ngettext(msgid`Delete ${name}`, `Delete ${count} contacts`, count);

console.log(result);
}

error1();
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "ttag-bug-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"author": "",
"license": "ISC",
"dependencies": {
"ttag": "^1.7.22"
}
}

0 comments on commit 5a550dd

Please # to comment.