Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66677

[fr] Empty folder UI

    XMLWordPrintable

Details

    Description

      Step to reproduce:

      • use fr language on web browser
      • create a new folder, save
      • go into folder, you have this screen

      "This folder is empty" and "All" are not translated when using fr localization.

      Not sure if this come from Jenkins Core or one plugin.

      Attachments

        Issue Links

          Activity

            I mean…

            • AllView has code for localizing the display name if the name is "all".
            • DefaultFolderViewHolder has code for renaming the AllView to "all" if it was created with a localized name (not display name).
            • AbstractFolder creates an AllView named "All".

            I think the AllView "All" created by AbstractFolder will be renamed to "all" by DefaultFolderViewHolder when Jenkins is restarted, and the localized display name will be displayed from then on.
            If that is true, then the proper fix would be to make AbstractFolder create the view as "all" in the first place so that DefaultFolderViewHolder wouldn't have to rename it later, and the display name would be localized without needing a Jenkins restart.

            kon Kalle Niemitalo added a comment - I mean… AllView has code for localizing the display name if the name is "all". DefaultFolderViewHolder has code for renaming the AllView to "all" if it was created with a localized name (not display name). AbstractFolder creates an AllView named "All". I think the AllView "All" created by AbstractFolder will be renamed to "all" by DefaultFolderViewHolder when Jenkins is restarted, and the localized display name will be displayed from then on. If that is true, then the proper fix would be to make AbstractFolder create the view as "all" in the first place so that DefaultFolderViewHolder wouldn't have to rename it later, and the display name would be localized without needing a Jenkins restart.
            teilo James Nord added a comment - - edited

            All is the name of something (just like a job).I would find it really confusing if the name of a job changed based on a locale, same for a view.

            The name of the view is also used in URLs (e.g. https://ci.jenkinsio.org/view/All/)  and as such the only thing you could possibly change is a displayName - but then see the first part about the job.

            The displayName already looks localizable -> https://github.com/jenkinsci/jenkins/blob/de59d930ad96e900d7994c6193b3af732fd110b7/core/src/main/java/hudson/model/AllView.java#L88 

            teilo James Nord added a comment - - edited All is the name of something (just like a job).I would find it really confusing if the name of a job changed based on a locale, same for a view. The name of the view is also used in URLs (e.g.  https://ci.jenkinsio.org/view/All/ )  and as such the only thing you could possibly change is a displayName - but then see the first part about the job. The displayName already looks localizable -> https://github.com/jenkinsci/jenkins/blob/de59d930ad96e900d7994c6193b3af732fd110b7/core/src/main/java/hudson/model/AllView.java#L88  

            With the current implementation, if you create a folder and then restart Jenkins, does the name of the AllView automatically change from “All” to “all” so that the French localisation takes effect?

            kon Kalle Niemitalo added a comment - With the current implementation, if you create a folder and then restart Jenkins, does the name of the AllView automatically change from “All” to “all” so that the French localisation takes effect?

            GitHub links:

            kon Kalle Niemitalo added a comment - GitHub links: https://github.com/jenkinsci/jenkins/blob/ca1d4a1146d0d8f7a54bf55b67d3ae6d1fccb944/core/src/main/resources/hudson/model/Messages_fr.properties#L76 Hudson.ViewName=Tous https://github.com/jenkinsci/jenkins/blob/632033d6ada7c04bbc77ae710dc0a4635fdf9baa/core/src/main/java/hudson/model/AllView.java#L88 returns Hudson.ViewName as the display name if the actual name is “all” (not “All”). According to JENKINS-38606 , the localised name should not affect how the view is created, but only how it is displayed. https://github.com/jenkinsci/cloudbees-folder-plugin/blob/6ba7831511247370f8e57bf1b2344ad898c9dc4f/src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java tries to rename the AllView to “all” so that the display name will be localised. https://github.com/jenkinsci/cloudbees-folder-plugin/blob/daf4ca032c70095bf1476b04ed907f636b65adcf/src/main/java/com/cloudbees/hudson/plugins/folder/Folder.java#L130 creates a ListView named “All”. However, your XML has an AllView rather than a ListView, so it was not created by this code. https://github.com/jenkinsci/cloudbees-folder-plugin/blob/664e0f8c4fe3e6a9846ec25d66da8f9e2426ea6f/src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java#L318 creates an AllView named “All”. I think this is a bug and it should use lower-case “all” aka AllView.DEFAULT_VIEW_NAME.
            avu12 Tamás Bőhm added a comment -

             Hi! Sadly with the other part I stucked without any clue. From the jobs (jenkins/war/work/job/ExampleName ) I see this example: 

            <folderViews class="com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder">
            <views>
            <hudson.model.AllView>
            <owner class="com.cloudbees.hudson.plugins.folder.Folder" reference="../../../.."/>
            <name>All</name>
            <filterExecutors>false</filterExecutors>
            <filterQueue>false</filterQueue>
            <properties class="hudson.model.View$PropertyList"/>
            </hudson.model.AllView>

            When I change it manually ,I see the change. But as this is generated, change needs to be happen somewhere else.  I found this similar example  in work\config.xml:

            <hudson.model.AllView>
            <owner class="hudson" reference="../../.."/>
            <name>all</name>
            <filterExecutors>false</filterExecutors>
            <filterQueue>false</filterQueue>
            <properties class="hudson.model.View$PropertyList"/>
            </hudson.model.AllView>

            This is where other part of the Jenkins correctly converted All -> Tous . In this scenario the src/main/resources/hudson/model/Messages_fr.properties file used 

            Hudson.ViewName=Tous

            In javadoc I see that Hudson has this key value :

             

            But in the Folder plugin Doc I did not find this Key option and my knowledge is very limited to understand how to implement it to the plugin.

            In AllView change did not help, I tried other property files in the plugin&core but none of them changed the value. Any new idea welcome.

            avu12 Tamás Bőhm added a comment -  Hi! Sadly with the other part I stucked without any clue. From the jobs (jenkins/war/work/job/ExampleName ) I see this example:  <folderViews class="com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder"> <views> <hudson.model.AllView> <owner class="com.cloudbees.hudson.plugins.folder.Folder" reference="../../../.."/> <name>All</name> <filterExecutors>false</filterExecutors> <filterQueue>false</filterQueue> <properties class="hudson.model.View$PropertyList"/> </hudson.model.AllView> When I change it manually ,I see the change. But as this is generated, change needs to be happen somewhere else.  I found this similar example  in work\config.xml: <hudson.model.AllView> <owner class="hudson" reference="../../.."/> <name>all</name> <filterExecutors>false</filterExecutors> <filterQueue>false</filterQueue> <properties class="hudson.model.View$PropertyList"/> </hudson.model.AllView> This is where other part of the Jenkins correctly converted All -> Tous . In this scenario the src/main/resources/hudson/model/Messages_fr.properties file used  Hudson.ViewName=Tous In javadoc I see that Hudson has this key value :   But in the Folder plugin Doc I did not find this Key option and my knowledge is very limited to understand how to implement it to the plugin. In AllView change did not help, I tried other property files in the plugin&core but none of them changed the value. Any new idea welcome.
            ajard A. Jard added a comment -

            Hi ! Thank you for looking.

            It's ok to add label for only one language, so you can only fill the *_fr.properties, it's not mandatory to fill all languages. If you fill comfortable in other language you can, but one translation is already great. If no properties exists Jenkins will render the default english version.

            ajard A. Jard added a comment - Hi ! Thank you for looking. It's ok to add label for only one language, so you can only fill the *_fr.properties, it's not mandatory to fill all languages. If you fill comfortable in other language you can, but one translation is already great. If no properties exists Jenkins will render the default english version.
            avu12 Tamás Bőhm added a comment - - edited

            Hi!

            I found the "This folder is  empty" part in the code: core/src/main/resources/hudson/model/AllView/noJob_fr.properties 
            As this language translation handled by properties files nearly all languages missing this sentence (but Turkish)  All of this noJob_xx.properties files need the 

            This\ folder\ is\ empty=<sentence in the other language> line.

            What is the correct way to handle it? 

            avu12 Tamás Bőhm added a comment - - edited Hi! I found the "This folder is  empty" part in the code: core/src/main/resources/hudson/model/AllView/noJob_fr.properties  As this language translation handled by properties files nearly all languages missing this sentence (but Turkish)  All of this noJob_xx.properties files need the  This\ folder\ is\ empty=<sentence in the other language> line. What is the correct way to handle it? 

            People

              Unassigned Unassigned
              ajard A. Jard
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: