7 Replies Latest reply on Sep 15, 2004 6:50 AM by arnaud.tessier

    Nukes language property file normalization

    theute

      We have different "norms" in the different modules for keys in property files (due to the fact that some property files were taken from PHPNukes). We should agree on some kind of normalization. Unfortunately i couldn't find any recommendation to stick with so we have to agree on something by ourself.

      We already have 1 file per module and i think it's ok for everybody.
      We could subdivide that file into chunks into the file to be easier to read. Let's take the news module example, we have admin stuff and other stuff, we have things related to comments, topics and stories, so we could start the key name by specifying this 'domain'.
      Something like:
      Admin.Comments.DeleteStory <- for admin stuff
      Comment.Title <- for general stuff (admin and not)
      with points or with underscores
      Admin_Comments_EnterTitle
      Comment_Title

      Then we should decide on the way to name keys using upper/lowercase
      Admin_Comments_EnterTitle
      admin_comments_enterTitle
      ADMIN_COMMENTS_ENTERTITLE
      ADMIN.COMMENTS.ENTER_TITLE

      In the code each key is preceded by the name of the module and a '.' like this: ${news.Admin.Comments.EnterTitle}

      What are your thoughts ? any recommendation ? When this will be decided, i will try to make a little guide for module developers with norms we use (along with JBoss coding rules).

      Please comment on stuff above. I personally like {news.Admin.Comments.EnterTitle} better but i don't really care as long as we all choose the same notation.

        • 1. Re: Nukes language property file normalization
          jae77

          i don't think there is anything wrong w/ that altho what would the convention be for an "everybody" message?

          something like:

          news.Comments.CommentsTotal

          • 2. Re: Nukes language property file normalization
            theute

            Yes

            Well that's what i thought, nothing really defined here.

            • 3. Re: Nukes language property file normalization
              chasetec

              You would have to mention this right after I got all the text moved from the downloads module source code into the properties file. :)

              If we do this we should also include guidelines for naming in the templates as well.

              Personally I like ADMIN_COMMENTS_ENTERTITLE since we're sort of defining constants and the periods just make me want to think references.

              -Chase

              • 4. Re: Nukes language property file normalization

                I like this one too

                "chasetec" wrote:
                You would have to mention this right after I got all the text moved from the downloads module source code into the properties file. :)

                If we do this we should also include guidelines for naming in the templates as well.

                Personally I like ADMIN_COMMENTS_ENTERTITLE since we're sort of defining constants and the periods just make me want to think references.

                -Chase


                • 5. Re: Nukes language property file normalization
                  theute


                  Well i will follow you even though that's the one i like the least :) I think EnterTitle is easier to read that ENTERTITLE.

                  But ok... If no one comes with a new great idea i guess we will take ADMIN_COMMENTS_ENTERTITLE as a norm.

                  (sorry Chase about pointing that out too late for you, i want too make sure less people will have to do this boring work of converting stuff)

                  • 6. Re: Nukes language property file normalization
                    cnovara

                    I'm working on localization, and thus on .properties files.
                    Here is my feeling on keys standards (anyway it's a bit late) :
                    Full uppercase, OK looks like C constants ;
                    Show hierarchy with underscore, OK dots are already hardly used ;

                    But should we delete the first underscore ? It's is so widely used in existent files and it's so nice to use in regex like core\._.*
                    While core\..* matches every core objets properties ...

                    But well ... we have to make a decision, standards are standards

                    • 7. Re: Nukes language property file normalization

                      Hi all,

                      I work on french translation too. Is it possible to synchronize the translations between the different developers ?
                      Where can we put the modules when we think it is translated ( in CVS database ?) ?

                      Thanks.