Community
Participate
Working Groups
Mik suggested using the templates mechanism (RepositoryTemplate). If we did this then a plugin could be provided that simply contributes a template for at particular repository along with the appropriate language. The language could be a sub element of the template extension point. Franks Comments from bug#173352 * If this is the enduser who is not a bugzilla admin then I think a preference page or a button in the BugzillaRepositorySettingPage. The same in someone use a Bugzilla which has localized templates. * If you think that Mylyn should set up all the language settings for the localized bugzilla templates (actually 17) with more then one available versions then I think the templates mechanism should be used.
Created attachment 80843 [details] new version of templates.exsd Question to emplates.exsd 1) is it what you expected that language is an sequence to the extention or 2) should language be an sequence to the repository element Result 1) let you define an language for all bugzilla repositories but hen you need an new attribute (languageChoice) to say what language you want to Choice. It is possible to an a new repository via popup menu 'Add Task Repository'. 2) It exists only one language settings per repository. But I see no way how to add a new repository with language settings via popup menu 'Add Task Repository'. Is it right that 1) is the way to go one? If yes then should we move BugzillaLanguageSettings from BugzillaCorePlugin to BugzillaRepositoryConnector? BTW Should we do some cleanup on BugzillaLanguageSettings? To me it looks like invalid is only used with password so I think why not use 'Invalid Username Or Password' from bugzilla template/en/default/global/user-error.html.tmpl. Maybe ohters can change in the same way.
Created attachment 80844 [details] mylyn/context/zip
I think (1) is the way to go here and the language extension point could have a connector kind field. Language templates as you suggest should be migrated to the connector (much like RepositoryTemplate). Mik, perhaps these is a better baby step here before moving into the frame work though? Regarding cleanup of BugzillaLanguageSettings, perhaps the template should consist of a token name like 'login' which maps to a sequence of acceptable variants (rather than having to have login2 like I added).
Created attachment 81009 [details] mylyn/context/zip Some pointers...
(In reply to comment #3) > Regarding cleanup of BugzillaLanguageSettings, perhaps the template should > consist of a token name like 'login' which maps to a sequence of acceptable > variants (rather than having to have login2 like I added). What do you think about the following implementation Sequence of Strings for the following entries - RepositoryStatus.ERROR_REPOSITORY_LOGIN - RepositoryStatus.REPOSITORY_COLLISION - RepositoryStatus.REPOSITORY_COMMENT_REQUIRED - RepositoryStatus.REPOSITORY_LOGGED_OUT - BugzillaTaskHistoryParser.possibleBadLogin for RepositoryStatus.ERROR_REPOSITORY_LOGIN and BugzillaTaskHistoryParser.possibleBadLogin we must change the and condition of "Invalid" and "Password" to match on string. This can be 'Invalid Username Or Password' The Result for 'en' and 'de' can look like possibleBadLogin en = "Login", "check e-mail", "Invalid Username Or Password", "error" de = "Anmeldename erforderlich", "check e-mail", "Ungütiger Benutzername oder ungültiges Passwort", "error" ERROR_REPOSITORY_LOGIN en = "Login", "log in", "check e-mail", "Invalid Username Or Password" de = "Anmeldename erforderlich", "check e-mail", "Ungütiger Benutzername oder ungültiges Passwort" REPOSITORY_COLLISION en = "Mid-air collision!" de = "Kollision!" REPOSITORY_COMMENT_REQUIRED en = "Comment Required" de = "Kommentar erforderlich" REPOSITORY_LOGGED_OUT en = "logged out" de = "Abgemeldet" Should I go and implement it like this Rob can you tell me what was the errorsituation for login2. I can not find it in the bugzilla templates within a titel
Created attachment 81664 [details] patch with new Language extention some points - is it Ok to extend BugzillaCorePlugin to access AbstractRepositoryConnector or is there a better way? - I only ad on test for the english version of invalid user or password. Is it possible to have an bugzilla installation with germzilla for testing? - I think the definition of languages from extentionpoint is finished. What is next? Should we allow other ways of configuration and how to sync them?
Created attachment 81665 [details] mylyn/context/zip
Created attachment 81883 [details] changed patch I add testMidAirCollision and do some cleanup
Created attachment 81884 [details] mylyn/context/zip
Created attachment 81907 [details] Updated patch This is really great stuff Frank. I just have some tests failing when running all bugzilla tests so we need to look into this. Once the tests are passing we can apply this and then consider the refinements. I'm posting an updated version of your patch to work from. We can iterate on this and get into next weeks build.
(In reply to comment #10) > Created an attachment (id=81907) > Updated patch > > This is really great stuff Frank. I just have some tests failing when running > all bugzilla tests so we need to look into this. Once the tests are passing we > can apply this and then consider the refinements. I'm posting an updated > version of your patch to work from. We can iterate on this and get into next > weeks build. Hi Rob, sorry for the failing of some tests. Over the weekend I will look at this and give you an version in which all test get green.
No worries Frank, some of the BugzillaRepositoryConnectorTest failures are unrelated to your patch.
(In reply to comment #12) > No worries Frank, some of the BugzillaRepositoryConnectorTest failures are > unrelated to your patch. Thats right but the testReassign tests get failed to so a reset them to the default assignee.
(In reply to comment #10) > This is really great stuff Frank. I just have some tests failing when running > all bugzilla tests so we need to look into this. Once the tests are passing we > can apply this and then consider the refinements. I'm posting an updated > version of your patch to work from. We can iterate on this and get into next > weeks build. Hi Rob, can I help here?
I have all tests passing now so will look at this again. Sorry for the delay.
After talking to Mik about this I realize we have to move the implementation back within the Bugizilla component. Since languages as the a Bugzilla implementation detail it should remain a Bugzilla specific capability. This should be a simple refactoring i.e. moving extension point and moving AbstractRepositoryConnector code to BugzillaRepositoryConnector etc. Wrt the extension point, ideally it should be a sequence of languageAttributes along the lines of: <element name="languageAttribute"> <complexType> <attribute name="command" type="string"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="response" type="string"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> Then the extension point reader would read in all these command/response pairs which are then held by LanguageSettings (move back into bugzilla). The trick will then be knowing which command to get the response string for so each command may need a constant. I apologize for not catching this sooner Frank.
Created attachment 83165 [details] New Version of Patch Some Comments. 1) testSubTaskHasIncoming fails because since 2007-11-16 14:43:05 bug 8 was removed from the Depends on list so task.getChildren().size() returns 1. 2) I think we should do some clean up of the command/responce entry. By example I can not find "check e-mail" in any title, so we can remove it. 3) Describe where in the bugzilla "en" template the responce strings so it is easy to found them in the localized versions. BTW I also found that the Title was not correctly calculated.
Created attachment 83166 [details] mylyn/context/zip
Great stuff here Frank. Patch applied and ip log have been updated. Lets leave 'check e-mail' as this may be returned by an older repository. I fixed (1) and I'm not certain I understand point (3). My only outstanding concern here is that BugzillaRepositoryConnector.getLanguageSetting() can return null. In the case of headless usage of this api things will not work unless a language is manually specified (I'll need to document this on the wiki). Ideally this would return the 'en' template however this would require a hard coded version of this class. Thoughts?
(In reply to comment #19) > Great stuff here Frank. Patch applied and ip log have been updated. Lets leave > 'check e-mail' as this may be returned by an older repository. I fixed (1) and > I'm not certain I understand point (3). Ok try to explain this in detail. If we by example document that the value "Mid-air collision!" is the String defined as an title in file bugzilla-2.18.6/template/en/default/bug/process/header.html.tmpl line 31. Then for translate the String to german we must only look in file bugzilla-2.18.6/template/de/default/bug/process/header.html.tmpl fo find the translate of line 31. > My only outstanding concern here is > that BugzillaRepositoryConnector.getLanguageSetting() can return null. In the > case of headless usage of this api things will not work unless a language is > manually specified (I'll need to document this on the wiki). Ideally this would > return the 'en' template however this would require a hard coded version of this > class. Thoughts? What is if we hard code the en version and only use addLanguageAttribute for the translated versions. One other thing. There is a problem with charactersets. The content of org.eclipse.mylyn.bugzilla.ui plugin.xml that I get from the repository <languageAttribute command="error_login" response="Ung‚à ö¬¢√Ä√ú‚âà ¬∞‚à ö√ᬨ‚à ´tiger Benutzername oder ung‚à ö¬¢√Ä√ú‚âà ¬∞‚à ö√ᬨ‚à ´ltiges Passwort"/> but the response should be response="Ungültiger Benutzername oder ungültiges Passwort"
(In reply to comment #20) > (In reply to comment #19) > > Great stuff here Frank. Patch applied and ip log have been updated. Lets leave > > 'check e-mail' as this may be returned by an older repository. I fixed (1) and > > I'm not certain I understand point (3). > Ok try to explain this in detail. > If we by example document that the value "Mid-air collision!" is the String > defined as an title in file > bugzilla-2.18.6/template/en/default/bug/process/header.html.tmpl line 31. Then > for translate the String to german we must only look in file > bugzilla-2.18.6/template/de/default/bug/process/header.html.tmpl > fo find the translate of line 31. We could document this on a link from http://wiki.eclipse.org/Mylyn_Bugzilla_Connector > What is if we hard code the en version and only use addLanguageAttribute for the > translated versions. Yes this sounds like the right way to go, and if we make BugzillaLanguageTemplate override equals and hash code and base equality on the language name the 'en' hard coded template could be overridden if desired by providing a new 'en' template via extension point. > One other thing. > There is a problem with charactersets. The content of Apparently the create patch functionality doesn't support UTF-8. This should now be fixed in head.
Created attachment 84265 [details] followup patch (In reply to comment #21) > >We could document this on a link from http://wiki.eclipse.org/Mylyn_Bugzilla_Connector If you think it is up to me to do this I need a little more information. And after I edit be so kind and properly correct my not so perfect english. > > Yes this sounds like the right way to go, and if we make > BugzillaLanguageTemplate override equals and hash code and base equality on the > language name the 'en' hard coded template could be overridden if desired by > providing a new 'en' template via extension point. What do you think to have "en (builtin)" and not to deal with hash code?
Created attachment 84266 [details] mylyn/context/zip
(In reply to comment #22) > >We could document this on a link from > http://wiki.eclipse.org/Mylyn_Bugzilla_Connector > If you think it is up to me to do this I need a little more information. And > after I edit be so kind and properly correct my not so perfect english. I may have miss understood. Do you mean to automatically parse the template to decipher the returned strings? > > > > Yes this sounds like the right way to go, and if we make > > BugzillaLanguageTemplate override equals and hash code and base equality on > the > > language name the 'en' hard coded template could be overridden if desired by > > providing a new 'en' template via extension point. > > What do you think to have "en (builtin)" and not to deal with hash code? "en (default)" could work
By the way, guys don't you think it will be better to use property files, so this i18n-related stuff won't be encoded inside plugin.xml? It will also have advantage of editing these settings independently.
I think we're safe with this if we're encoding in utf-8.
(In reply to comment #24) > (In reply to comment #22) > > >We could document this on a link from > > http://wiki.eclipse.org/Mylyn_Bugzilla_Connector > > If you think it is up to me to do this I need a little more information. And > > after I edit be so kind and properly correct my not so perfect english. > > I may have miss understood. Do you mean to automatically parse the template to > decipher the returned strings? No I don't think that automaticlly is right. I would like to describe this like a cokbook. That mens what are the steps do add an actually not supported language. BTW If we want to do that does that meen that we have to do somethink like a Eclipse-RegisterBuddy: to allow the definition of a new laguagesetting
Created attachment 84464 [details] new patch change en (builtin) to en (default)
Created attachment 84465 [details] mylyn/context/zip
Patch applied with the following changes: I extracted the constant to IBugzillaConstants.DEFAULT_LANG and removed dead code from RepositoryTemplate. Had to override hashcode and equals to ensure we don't get duplicate languages. Updated BugzillaRepositoryConnector.getLanguageSetting() to return the default language rather than null. Removed 'en' template from plugin.xml to avoid duplication in ui. Ip log updated. (In reply to comment #27) > No I don't think that automaticlly is right. I would like to describe this like > a cokbook. That mens what are the steps do add an actually not supported > language. Cookbook style entry on the wiki page I mentioned would be great for this. > BTW If we want to do that does that meen that we have to do somethink like a > Eclipse-RegisterBuddy: to allow the definition of a new laguagesetting This should just be a matter of extending the "org.eclipse.mylyn.bugzilla.core.languages" extension point and your extension point reader will do the rest. You could document this as well on that wiki page. Marking resolved...
Created attachment 84482 [details] cleanup I correct the decription of public BugzillaLanguageSettings getLanguageSetting(String label). (In reply to comment #30) > (In reply to comment #27) > > No I don't think that automaticlly is right. I would like to describe this > like > > a cokbook. That mens what are the steps do add an actually not supported > > language. > > Cookbook style entry on the wiki page I mentioned would be great for this. I never edit a wiki page before. Please tell me what to do and I start with this tonigth. > > > BTW If we want to do that does that meen that we have to do somethink like a > > Eclipse-RegisterBuddy: to allow the definition of a new laguagesetting > This should just be a matter of extending the > "org.eclipse.mylyn.bugzilla.core.languages" extension point and your extension > point reader will do the rest. You could document this as well on that wiki > page. >
Created attachment 84483 [details] mylyn/context/zip
Patch applied ip log updated. To edit the wiki, just go to http://wiki.eclipse.org/Mylyn_Bugzilla_Connector and click 'Edit' in the menu on the left. You will be asked to login. Use your bugzilla email and passwd to login. For some reason you sometimes have to capitalize the first character of your user name to log in. For wiki syntax see http://en.wikipedia.org/wiki/Wikipedia:How_to_edit_a_page Don't worry too much about layout though.
Sorry, I found that I have not changed the retrieveHistory Method in BugzillaTaskHistoryParser so a other patch is needed.
Created attachment 84669 [details] patch of BugzillaTaskHistoryParser see Comment #34
Created attachment 84670 [details] mylyn/context/zip
Good catch. Patch applied, ip log updated. Feel free to mark this one resolved Frank.
(In reply to comment #33) > Patch applied ip log updated. > > To edit the wiki, just go to http://wiki.eclipse.org/Mylyn_Bugzilla_Connector > and click 'Edit' in the menu on the left. You will be asked to login. Use your > bugzilla email and passwd to login. For some reason you sometimes have to > capitalize the first character of your user name to log in. > Have you seen waht I insert in http://wiki.eclipse.org/Mylyn_Bugzilla_Connector ? Any comments?
I had a look Frank and this looks perfect!
After http://wiki.eclipse.org/Mylyn_Bugzilla_Connector is OK, I think we can close this one.
Now realy closed.
Great job on this and the documentation Frank.
*** Bug 209132 has been marked as a duplicate of this bug. ***