Git Product home page Git Product logo

Comments (9)

tricoder42 avatar tricoder42 commented on May 21, 2024 1

Coolio! I'm just working on the fix, should be ready in an hour. Thank you for your feedback 👍

from js-lingui.

tricoder42 avatar tricoder42 commented on May 21, 2024

This is related to #65. The CLI doesn't know, that message IDs are translations for cs language.

I'm thinking about another config variable: sourceLanguage. When set, translations are taken from message ID for given language during compile. What do you think?

It also means that you'll never get warning for missing translation for that language, but I guess it doesn't matter, because you're using source anyway.

from js-lingui.

vitexikora avatar vitexikora commented on May 21, 2024

Well it has to be working without translations by showing the original, so it could help the translator & don't break the app design before translations are added.
So your solution would be adding sourceLanguage: 'cs' to the config, and then it would show the original for Czech language (but not the others)? What about showOriginalWhenMissing ?

from js-lingui.

tricoder42 avatar tricoder42 commented on May 21, 2024

So you would like to see Czech source string even for other languages? 🤔

I'm thinking that maybe it should be the default behavior. When developer what's to get an error about missing translation, they can use lingui compile --strict. Otherwise, the source string will be used, because missing translation should never happen in production (I guess it's better to see well-formatted message in wrong language, rather than unformatted message in correct language).

from js-lingui.

tricoder42 avatar tricoder42 commented on May 21, 2024

I guess the sourceLanguage config is still useful when you use natural language in message IDs. Usually it means, that one message catalog will always be untranslated (the source one - cs in your case) and you don't want to get an error when validating missing translations.

from js-lingui.

vitexikora avatar vitexikora commented on May 21, 2024

it's better to see well-formatted message in wrong language, rather than unformatted message in correct language

Yes.

So you would like to see Czech source string even for other languages?

For this project, yes. English and other languages will be only marginally used and a few missing translations will not be a problem (of course we will try to have always 100%, but its better to have a minor tooltip/notification in Czech than an unformatted string).
And for a next big project (there will be a team of several devs), that I had also proposed lingui-js to be used 😊, we will use English language as default and we will like to show English messages, if eg. a Spanish one would be missing. We will likely use IDs tho, so this is not yet the problem.

from js-lingui.

vitexikora avatar vitexikora commented on May 21, 2024

Awesome! And yes, sourceLanguage is still useful, if we would add translation validation into our CI. I already have extract & compile there, so no message should be unformatted, even if someone forgot to do it before pushing.

from js-lingui.

tricoder42 avatar tricoder42 commented on May 21, 2024

Fixed in [email protected]

Would you like to share the name of your company so I can present it in README as a social proof?

from js-lingui.

tricoder42 avatar tricoder42 commented on May 21, 2024

Also, new CLI options published in docs

from js-lingui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.