You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Richard Eckart de Castilho <re...@apache.org> on 2022/01/20 11:40:49 UTC

Localized messages in UIMA - important for anybody?

Hi all,

another question...

In many (but not all) places, UIMA uses so-called resource bundles to maintain its exception or log messages. These files look like this:

----
UIMA_CPM_show_cp_pool_size__FINEST = CAS Processor Pool. \
  (Thread: {0}) Total Size: {1} Free In Pool: {2}
  
UIMA_CPM_cp_pool_empty__WARNING = The CAS processor pool is empty. \
  (Thread: {0}) Total size: {1} Free in pool: {2}

UIMA_CPM_cpm_not_running__WARNING = The CPM is not running. \
  (Thread: {0})
----

The code required then to log a message 

----
      UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
              "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cpm_not_running__WARNING",
              new Object[] { Thread.currentThread().getName() });
----

Now, you can see that this is quite a bit more complex than simply writing

----
     logger.warn("The CPM is not running. (Thread: {})", Thread.currentThread().getName());
----

Now, there are alternative ways of doing localized messages, but before looking into those, I really do wonder: 

Does anybody really need the ability to localize these messages? 

Afaik messages in the UIMA code repositories are only English, so if anybody uses the localization, they must be using it without contributing their localization back to the project. Personally, I tend to thing that nobody uses it and nobody would complain if it got removed. But better to ask then to simply nix it ;)

So, please reply if localized messages in UIMA mean anything to you.

Best,

-- Richard

Again CCed to dev@uima, but reply-to set to user@uima.

Re: Localized messages in UIMA - important for anybody?

Posted by "Zesch, Torsten" <to...@uni-due.de>.
In many years of using UIMA I have never had the desire to write localized messages. My blessing you have ...

-Torsten

1.22, 12:41, "Richard Eckart de Castilho" <re...@apache.org> wrote:

    Hi all,

    another question...

    In many (but not all) places, UIMA uses so-called resource bundles to maintain its exception or log messages. These files look like this:

    ----
    UIMA_CPM_show_cp_pool_size__FINEST = CAS Processor Pool. \
      (Thread: {0}) Total Size: {1} Free In Pool: {2}

    UIMA_CPM_cp_pool_empty__WARNING = The CAS processor pool is empty. \
      (Thread: {0}) Total size: {1} Free in pool: {2}

    UIMA_CPM_cpm_not_running__WARNING = The CPM is not running. \
      (Thread: {0})
    ----

    The code required then to log a message 

    ----
          UIMAFramework.getLogger(this.getClass()).logrb(Level.WARNING, this.getClass().getName(),
                  "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cpm_not_running__WARNING",
                  new Object[] { Thread.currentThread().getName() });
    ----

    Now, you can see that this is quite a bit more complex than simply writing

    ----
         logger.warn("The CPM is not running. (Thread: {})", Thread.currentThread().getName());
    ----

    Now, there are alternative ways of doing localized messages, but before looking into those, I really do wonder: 

    Does anybody really need the ability to localize these messages? 

    Afaik messages in the UIMA code repositories are only English, so if anybody uses the localization, they must be using it without contributing their localization back to the project. Personally, I tend to thing that nobody uses it and nobody would complain if it got removed. But better to ask then to simply nix it ;)

    So, please reply if localized messages in UIMA mean anything to you.

    Best,

    -- Richard

    Again CCed to dev@uima, but reply-to set to user@uima.