Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Internationalization of write_config() text

    Scheduled Pinned Locked Moved 2.3-RC Snapshot Feedback and Issues - ARCHIVED
    3 Posts 2 Posters 794 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      phil.davis
      last edited by

      Sometimes the text supplied with a write_config() call is internationalized with gettext() and thus can potentially log that in the config history in some language other than English, e.g.

      /usr/local/www/index.php:       write_config(gettext("Widget configuration has been changed."));
      

      Should all the write_config("text") calls be done that way - write_config(gettext("text")) ?

      I would seem OK to me that config history text can be recorded in the user's chosen language.

      Also there are many (many many) write_config() calls that have no text supplied at all. I would find it helpful if the text in the config history were better (or existed at all), so I am happy to put some (hopefully useful) text in each write_config() call.

      Should I just do a few and submit a PR with typical examples of what I think is good?

      Then it can be reviewed and I can proceed doing it in ways that reviewers [have suggested|agree with].

      As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
      If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

      1 Reply Last reply Reply Quote 0
      • rbgargaR
        rbgarga Developer Netgate Administrator
        last edited by

        @phil.davis:

        Sometimes the text supplied with a write_config() call is internationalized with gettext() and thus can potentially log that in the config history in some language other than English, e.g.

        /usr/local/www/index.php:       write_config(gettext("Widget configuration has been changed."));
        

        Should all the write_config("text") calls be done that way - write_config(gettext("text")) ?

        I would seem OK to me that config history text can be recorded in the user's chosen language.

        Also there are many (many many) write_config() calls that have no text supplied at all. I would find it helpful if the text in the config history were better (or existed at all), so I am happy to put some (hopefully useful) text in each write_config() call.

        Should I just do a few and submit a PR with typical examples of what I think is good?

        Then it can be reviewed and I can proceed doing it in ways that reviewers [have suggested|agree with].

        Yeah, definitely it's a good idea. Just need to check if the tag used to store these strings uses CDATA on config.xml to avoid breaking it

        Renato Botelho

        1 Reply Last reply Reply Quote 0
        • P
          phil.davis
          last edited by

          The revision section of config.xml has a good-looking description format

          	 <revision><time>1452883508</time>
          
          		<username>admin@192.168.1.100</username></revision> 
          
          

          and that is what is written to and used by diag_confbak to display the reason for each config in the history.
          So it looks good to be multi-lingual.

          As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
          If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.