13 Replies Latest reply on Jun 30, 2008 8:29 AM by akazakov

    Code assist with non-default locale

    wilczarz

      Hi,

      Is there a way to set locale in jboss tools?

      I changed the default locale in my seam application (by editing faces-config.xml) but the content assist in the html editor still looks up for entries in messages_en.properties.

      Thanks

        • 1. Re: Code assist with non-default locale
          maxandersen

          I think it uses the normal lookup rules and hence uses the javavm default.

          Obviously that shuold be different.

          Please open a feature request in jira.

          Thanks

          • 2. Re: Code assist with non-default locale
            wilczarz

            The default locale on my system is pl_PL, so this can't be the problem. Plus, if I delete the messages_en.properties, then entries from messages_pl.properties are visible in the content assist box. Of course, I don't want to delete it, so I thik I'll pass on this feature.

            In my opinion, a different feature would be very useful. Since EL causes problems with bundle keys containing dots:

            <h:outputText value="#{messages.client.title}"/>

            interpreting "title" as a property of "client", it would be great to have content assist available with ['...'] notation, that is
            <h:outputText value="#{messages['client.title']"/>


            Don't you think? :)



            • 3. Re: Code assist with non-default locale
              maxandersen

               

              "wilczarz" wrote:
              The default locale on my system is pl_PL, so this can't be the problem. Plus, if I delete the messages_en.properties, then entries from messages_pl.properties are visible in the content assist box. Of course, I don't want to delete it, so I thik I'll pass on this feature.


              You don't want a feature to control which locale we will use ? :


              In my opinion, a different feature would be very useful. Since EL causes problems with bundle keys containing dots:
              <h:outputText value="#{messages.client.title}"/>

              interpreting "title" as a property of "client", it would be great to have content assist available with ['...'] notation, that is
              <h:outputText value="#{messages['client.title']"/>


              Don't you think? :)


              We already implemented that for Seam EL code completion for the messages componeint (in 2.1.x) - if it does not work for simple JSF then that is a bug and should be re ported in jra.


              • 4. Re: Code assist with non-default locale
                wilczarz

                 

                "max.andersen@jboss.com" wrote:

                You don't want a feature to control which locale we will use ? :


                Sure I do, I meant I'd pass on CA until you resolve locale problem.
                The ['..'] proposals DO work, I just tried it after typing "[", insead of "."

                Keep up the good work! ;-)

                • 5. Re: Code assist with non-default locale
                  maxandersen

                  ok - but please report an issue in jira so it wont get lost.

                  thanks.

                  • 6. Re: Code assist with non-default locale
                    wilczarz
                    • 7. Re: Code assist with non-default locale
                      maxandersen

                      Thanks!

                      • 8. Re: Code assist with non-default locale
                        wilczarz

                        Max, I need one more advice with the content assist.

                        I created a new project with seam-gen (imported it into eclipse by new project-general-project) and now code assist is unavailable for messages component. For other componens, also the ones created by me, all works fine. The messages component (or at least its name) is visible but when I type #{messages. and press ctrl+space I'm getting

                        Content assist not available at current location

                        The behavior I described is insensitive for locale setting in faces-config.xml and presence of messages_XX.properties files.

                        • 9. Re: Code assist with non-default locale
                          vrubezhny

                           

                          "wilczarz" wrote:
                          Max, I need one more advice with the content assist.

                          I created a new project with seam-gen (imported it into eclipse by new project-general-project)...


                          Wilczarz, Could you post or attach the .project file from your project?

                          What is your JBossTools and Seam version?

                          Thanks,
                          Victor


                          • 10. Re: Code assist with non-default locale
                            wilczarz

                            Here goes my .project file:

                            <?xml version="1.0" encoding="UTF-8"?>
                            <projectDescription>
                             <name>CreditRating</name>
                             <comment></comment>
                             <projects>
                             </projects>
                             <buildSpec>
                             <buildCommand>
                             <name>org.eclipse.jdt.core.javabuilder</name>
                             <arguments>
                             </arguments>
                             </buildCommand>
                             <buildCommand>
                             <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
                             <triggers>auto,full,incremental,</triggers>
                             <arguments>
                             <dictionary>
                             <key>LaunchConfigHandle</key>
                             <value><project>/explode.launch</value>
                             </dictionary>
                             </arguments>
                             </buildCommand>
                             </buildSpec>
                             <natures>
                             <nature>org.eclipse.jdt.core.javanature</nature>
                             <nature>org.hibernate.eclipse.console.hibernateNature</nature>
                             <nature>org.jboss.tools.seam.core.seamnature</nature>
                             </natures>
                            </projectDescription>
                            


                            I use seam 2.0.1.GA and JbossTools 1.1.0.GA.

                            My further observation is that my ejb components are visible in code assist and my pojo components aren't. Some, like messages, are visible but its content is unavailable..


                            • 11. Re: Code assist with non-default locale
                              akazakov

                              It's an issue of seam-gen 2.0.1. It adds seam tools nature into .project but doesn't add seam builder.
                              We have it somewhere in jira (can't find it now).
                              So please try:
                              1. Project->Properties->Seam Settings
                              2. Uncheck "Seam Suport". Press "Applay". It will remove seam nature.
                              3. Check "Seam Suport" again. Press "Applay". It will add seam nature and seam builder.
                              4. Build your project.

                              • 12. Re: Code assist with non-default locale
                                wilczarz

                                Ok, my components are now visible, but "messages" component is still "unavailable at current location". I tried to look for it in the component view but it's not there.. Any ideas?

                                • 13. Re: Code assist with non-default locale
                                  akazakov

                                  Seam-gen puts messages*.properties into /resources folder.
                                  That folder is not in Java build path. Please
                                  - move all messages_*.properties in /src/model/
                                  - or set /resources as source folder: Project->Properties->Java Build Path->Source->Add folder...