guigrpa / mady

An easy-to-use tool to manage and translate ICU MessageFormat messages
MIT License
90 stars 11 forks source link

Mady translations showing up blank #18

Closed gfcf14 closed 6 years ago

gfcf14 commented 6 years ago

Hi @guigrpa , I've been trying to use mady in order to translate text for my project, formatted this way:

export const ENGLISH_STATE = {
  lang: 'en',
  messages: {
    'label': 'English',
    'login.password': 'Password',
    'login.confirm': 'Confirm Password',
  },
};

Because my project needs to follow this format, I thought of using the Regex option in order to add the text I want and see its translation:

screen shot 2018-10-09 at 12 46 41 pm

And, while that works, the translated text appears blank:

screen shot 2018-10-09 at 12 51 07 pm

I've also tried formatting my text so it looks like a function:

screen shot 2018-10-09 at 2 23 18 pm

But the same issue persists:

screen shot 2018-10-09 at 2 24 18 pm

Why would this be happening? Please help me understand if I'm not using it right. Should you need it, here is my config.json file:

{
  "dbVersion": 2,
  "srcPaths": [
    "src/testtranslation"
  ],
  "srcExtensions": [
    ".js",
    ".jsx",
    ".coffee",
    ".cjsx"
  ],
  "langs": [
    "en",
    "es",
    "ca",
    "en-US",
    "en-GB"
  ],
  "msgFunctionNames": [
    "_t"
  ],
  "msgRegexps": [
    "(?<=: ')(.*)(?=')"
  ],
  "fJsOutput": true,
  "fMinify": false,
  "fJsonOutput": true,
  "fReactIntlOutput": true,
  "originalLang": "en"
}
guigrpa commented 6 years ago

I don't understand the problem. The messages seem to be detected properly, at least looking at the last snapshot. Where is the problem exactly?

gfcf14 commented 6 years ago

The problem I have is that the translations don't show. Like, wouldn't the es section say label2 Ingles for example?

gfcf14 commented 6 years ago

I'm sorry. I'm afraid I misunderstood. I believed the program was supposed to translate it all for you

guigrpa commented 6 years ago

No worries, I'm glad you figured it out!

Note however that Mady can help you with automatic translation based on Google Translate.