From: Lars H. <he...@se...> - 2006-03-21 16:37:04
|
Hi Holger, [...] > Depending on the locale of the client=E2=80=99s system, the correct bas= e name > should be shown. [...] > There is a method 'addPreferredTheme(Topic theme)' in the > TopicNameExtractor-Class that I have been trying to use to solve that > problem. How about: static final String TM_LANG =3D "http://www.topicmaps.org/xtm/1.0/language.xtm" Locale locale =3D Locale.getDefault(); // Note that the ISO 639 is not stable String preferredLang =3D locale.getLanguage().equals("de") ? "de" : "en"; // Used to create the subject identifier String langReference =3D TM_LANG + preferredLang; // Subject identifier Locator langLocator =3D topicMap.getBaseLocator().resolveRelative(loc); // Fetch topic by the subject identifier Topic langTopic =3D topicMap.getTopicBySubjectIndicator(langLoc); if (langTopic =3D=3D null) { langTopic =3D topicMap.createTopic(); langTopic.addSubjectIndicator(langLocator); } nameExtractor.addPreferredTheme(langTopic); =20 Best regards, Lars --=20 http://semagia.com http://topicgarden.com/mailinglist/ German Topic Maps mailinglist |