Skip to content

Commit

Permalink
Remaining ttag references
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrobinson committed Apr 11, 2019
1 parent 1974815 commit 3d3ea80
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"extract": {
"plugins": [
["c-3po", {
["ttag", {
"extract": {
"output": "locales/metabase-frontend.pot"
},
Expand Down
2 changes: 1 addition & 1 deletion bin/i18n/build-translation-frontend-resource
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fs = require("fs");
const _ = require("underscore");
const gParser = require("gettext-parser");

// NOTE: this function replace xgettext "{0}" style references with c-3po "${ 0 }" style references
// NOTE: this function replace xgettext "{0}" style references with ttag "${ 0 }" style references
function replaceReferences(str) {
return str.replace(/\{ *(\d+) *\}/g, "${ $1 }");
}
Expand Down
2 changes: 1 addition & 1 deletion bin/i18n/update-translation-template
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mkdir -p "locales"
BABEL_ENV=extract ./node_modules/.bin/babel -q -x .js,.jsx -o /dev/null frontend/src
# BABEL_ENV=extract BABEL_DISABLE_CACHE=1 yarn run build

# NOTE: replace c-3po's "${ 0 }" style references with xgettext "{0}" style references for consistency
# NOTE: replace ttag's "${ 0 }" style references with xgettext "{0}" style references for consistency
sed -i".bak" -E 's/\$\{ *([0-9]+) *\}/{\1}/g' "$POT_FRONTEND_NAME"
rm "$POT_FRONTEND_NAME.bak"

Expand Down
2 changes: 1 addition & 1 deletion docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ We are an application with lots of users all over the world. To help them use Me

If you need to add new strings (try to be judicious about adding copy) do the following:

1. Tag strings in the frontend using `t` and `jt` ES6 template literals (see more details in https://c-3po.js.org/):
1. Tag strings in the frontend using `t` and `jt` ES6 template literals (see more details in https://ttag.js.org/):

```javascript
const someString = t`Hello ${name}!`;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/lib/i18n-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const obfuscateString = (original, string) => {
};

export function enableTranslatedStringReplacement() {
const c3po = require("c-3po");
const c3po = require("ttag");
const _t = c3po.t;
const _jt = c3po.jt;
const _ngettext = c3po.ngettext;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/lib/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function setLocalization(translationsObject) {
}

// we delete msgid property since it's redundant, but have to add it back in to
// make c-3po happy
// make ttag happy
function addMsgIds(translationsObject) {
const msgs = translationsObject.translations[""];
for (const msgid in msgs) {
Expand Down

0 comments on commit 3d3ea80

Please sign in to comment.