Code Monkey home page Code Monkey logo

Comments (3)

vsct-jburet avatar vsct-jburet commented on July 18, 2024

I agree with the remarks:

  • Label versioning should be available
  • We should have a simple option to setup all the messages in the code (and keep the ability to override the labels in the interface) - may be ressource bundle ?

from tock.

Fabilin avatar Fabilin commented on July 18, 2024

I am not too sure about ResourceBundle, since - as far as I know - we have no good way of listing defined locales. We would need that feature to write the default values to the database for use in TOCK Studio.

from tock.

Fabilin avatar Fabilin commented on July 18, 2024

After further consideration, Java's ResourceBundle API is technically usable, as we have the full list of locales supported by each bot. However, it has the following limitations:

  • Since TOCK would have to query the bundle for each locale, it would need to also take the bundle key as parameter (so 2 parameters, bundle key and resource key)
  • Locales cannot naturally express interface types (text, voice and text, voice) or connectors (web, slack, etc.). We could however work around that by defining a new convention for an "interface" and a "connector" language subtags.
  • Property resource bundles can only yield strings, not lists of strings as would be required to support the "alternatives" feature
  • ResourceBundle forces the creation of a new file for each locale, which may not be practical for developers that wish to modularize their localization (e.g. grouping translations per-story)

Since TOCK will have to extract something like a Map<(Locale, UserInterfaceType, Connector), List<String>> at some point regardless, I believe we should make it possible for programs to supply such data directly. We can then provide a ResourceBundle-based helper on top for applications that benefit from its use.

from tock.

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.