question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clear workflow example

See original GitHub issue

I am pretty sure I’m missing something basic here. But I don’t understand how is supposed to work in a full development cycle.

From my understanding:

  1. Add strings to source code formatMessage('My Account Preferences')
  2. Extract the strings to a json, yaml to be passed to translators format-message extract "src/**/*.js" > ./locales/en/messages.json
  3. Load those strings into your code depending on your locale by formatMessage.setup(....

Now the problem is, if add a new string, the step2 will overwrite all the strings, how do I just add some? The same for removing? Basically the problem is how to handle the evolution of strings and its translations.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
vanwagonetcommented, Nov 27, 2015

How would the following be?

Source code:

var fm = require('format-message')
fm.setup({
  generateId: require('format-message-generate-id/underscored_crc32'),
  translations: require('./strings')
})
// ...
fm('Hello, {location}', { location: 'Montreal' })
$ format-message extract --format db -l en -g underscored_crc32 -o ./strings.json

strings.json:

{
  "en": {
    "hello_location_12ef23": { "message": "Hello, {location}" }
  },
  "fr": {
    "hello_location_12ef23": { "message": "Bonjour, {location}" }
  }
}

Running format-message extract would only modify the section matching the -l locale.

Or would you prefer translations to live right next to the original?

formatMessage.setup({
  generateId: require('format-message-generate-id/underscored_crc32'),
  translations: formatMessage.db(require('./strings'))
})

strings.json

{
  "hello_location_12ef23": {
    "message": "Hello, {location}",
    "description": "Greeting shown on the first screen.",
    "translations": {
      "fr": "Bonjour, {location}",
      "pt": "Olá, {location}"
    }
  }
}
0reactions
vanwagonetcommented, May 7, 2021

I’m afraid I haven’t prioritized any work on this since I switched to app development years ago. I’m open to review changes and give permissions to a new maintainer, but I won’t be making changes myself, as I no longer use the library or spend much time in the JavaScript ecosystem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting a workflow run - GitHub Docs
To delete a workflow run, use the drop-down menu, and select Delete workflow run. Deleting a workflow run. Review the confirmation prompt and...
Read more >
What is a workflow? Definition and examples - Asana
Workflows are a structured series of steps that take you from the beginning to the end of a process. Workflows show stakeholders what...
Read more >
How To Delete Workflow Runs - Process Street
Click “Delete” again to finish (or cancel if you've changed your mind). If your workflow run was completed (or archived) you will need...
Read more >
How to Delete Approval Workflows - Business Central
Delete a workflow. Choose the Lightbulb that opens the Tell Me feature. icon, enter Workflows, then choose the related link. Select the workflow...
Read more >
Basic Concepts | TMS Workflow Studio documentation
Some basic concepts are presented here, for your clear understanding of how Workflow Studio works and its main components.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found