Changeset 5409
- Timestamp:
- Sep 16, 2010, 1:32:06 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/base.config
r5336 r5409 188 188 # Set to 1 to disable auto-compression of uploaded files 189 189 autocompress.disable = 0 190 191 # Locale settings are used to customize gui text and labels 192 # locale.language = 193 # locale.country = 194 # locacle.variant = 190 195 191 196 # =============== -
trunk/doc/src/docbook/appendix/base.config.xml
r5362 r5409 766 766 </listitem> 767 767 </varlistentry> 768 769 <varlistentry> 770 <term><property>locale.language</property></term> 771 <term><property>locale.country</property></term> 772 <term><property>locale.variant</property></term> 773 <listitem> 774 <para> 775 Configure the server to a specific locale. The language and 776 country should be valid ISO codes as specified by the 777 <ulink url="http://download.oracle.com/javase/6/docs/api/java/util/Locale.html" 778 >java.util.Locale</ulink> documentation. The variant 779 can be any value that is valid as part of a filename. 780 </para> 781 782 <note> 783 <para> 784 Note that language codes are usually lower-case but country codes are 785 upper case. Eg. <code>sv</code> is the language code for swedish, and 786 <code>SE</code> is the country code. 787 </para> 788 </note> 789 790 <para> 791 This configuration can be used to provide translations to some parts of the web gui. 792 The aim is to externalize all hard-coded gui elements from the code but 793 it's a long way before this is a reality. The default text elements of 794 the gui are shipped within the BASE jar files and doesn't have any 795 locale-specific dependency. This means that unless a more specific 796 translation is provided the default texts are always used as a fallback. 797 Most of the default texts are found in property files in the 798 <filename>/net/sf/basedb/clients/web/resources</filename> 799 directory inside the <filename>BASE2Webclient.jar</filename> 800 file. Translations should be located in the same relative path 801 either inside their own JAR file or in the <filename>WEB-INF/classes</filename> 802 directory. The file names should be extended with the language, country 803 and variant separated with an underscore. For example, files with a swedish 804 translation should be named <filename>*_sv.properties</filename>, and files 805 with a swedish translation in Finland using the 'foo' variant should be 806 named <filename>*_sv_FI_foo.properties</filename>. 807 </para> 808 809 <note> 810 <para> 811 Note that it is valid to have empty values for language and/or country 812 and still specify a variant. Underscores are NOT collapsed. For 813 example, in a swedish translation using the 'foo' variant the 814 files should be named <filename>*_sv__foo.properties</filename>. 815 </para> 816 </note> 817 818 <important> 819 <para> 820 All files should be saved in UTF-8 format. 821 </para> 822 </important> 823 824 </listitem> 825 </varlistentry> 826 768 827 </variablelist> 769 828 </simplesect> -
trunk/src/core/net/sf/basedb/core/Config.java
r5384 r5409 23 23 package net.sf.basedb.core; 24 24 25 import java.util.Locale; 25 26 import java.util.Properties; 26 27 import java.io.FileNotFoundException; … … 56 57 57 58 private static java.io.File configDir = null; 59 60 private static Locale locale = Locale.getDefault(); 58 61 59 62 /** … … 79 82 config.load(is); 80 83 if (overridden != null) config.putAll(overridden); 84 81 85 } 82 86 catch (Exception ex) … … 90 94 } 91 95 isInitialised = true; 96 97 // Load locale 98 String language = getString("locale.language", ""); 99 String country = getString("locale.country", ""); 100 String variant = getString("locale.variant", ""); 101 if (language.length() > 0 || country.length() > 0 || variant.length() > 0) 102 { 103 locale = new Locale(language, country, variant); 104 } 105 else 106 { 107 locale = Locale.getDefault(); 108 } 92 109 } 93 110 … … 256 273 } 257 274 275 /** 276 Get the default locale configured for the server. 277 @since 2.16 278 */ 279 public static Locale getLocale() 280 { 281 return locale; 282 } 258 283 259 284 } -
trunk/src/core/net/sf/basedb/core/SessionControl.java
r5384 r5409 51 51 import java.util.Date; 52 52 import java.util.Iterator; 53 import java.util.Locale; 53 54 import java.util.Set; 54 55 import java.util.Map; … … 1824 1825 1825 1826 /** 1827 Get the locale that is curently assigned to this session control. 1828 @return A Locale object 1829 @since 2.16 1830 */ 1831 public Locale getLocale() 1832 { 1833 return Config.getLocale(); 1834 } 1835 1836 /** 1826 1837 Get the value of a session setting with the specified name. 1827 1838 @param name The name of the setting -
trunk/www/include/menu.jsp
r5370 r5409 2 2 ------------------------------------------------------------------ 3 3 Copyright (C) 2005 Nicklas Nordborg, Gregory Vincic 4 Copyright (C) 2006 Jari H äkkinen, Nicklas Nordborg, Martin Svensson, Gregory Vincic4 Copyright (C) 2006 Jari H�kkinen, Nicklas Nordborg, Martin Svensson, Gregory Vincic 5 5 Copyright (C) 2007 Nicklas Nordborg 6 6 … … 56 56 import="net.sf.basedb.clients.web.Base" 57 57 import="net.sf.basedb.clients.web.util.HTML" 58 import="net.sf.basedb.clients.web.resources.Bundle" 58 59 import="net.sf.basedb.util.Values" 60 import="net.sf.basedb.util.resources.ResourceBundleWrapper" 61 import="net.sf.basedb.util.resources.ResourceBundleFactory" 59 62 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 60 63 import="net.sf.basedb.clients.web.extensions.JspContext" … … 78 81 final String root = request.getContextPath()+"/"; 79 82 if ("exception".equals(name) && sc != null && sc.isLoggedIn()) name = "standard"; 83 84 final ResourceBundleWrapper common = ResourceBundleFactory.getResourceBundle(Bundle.COMMON, sc); 85 final ResourceBundleWrapper menu = ResourceBundleFactory.getResourceBundle(Bundle.MENU, sc); 80 86 81 87 if ("login".equals(name)) … … 407 413 > 408 414 <m:menuitem 409 title="Home" 415 title="<%=menu.getString("home.title")%>" 416 tooltip="<%=menu.getString("home.tooltip")%>" 410 417 onclick="<%="Menu.openUrl('"+root+"my_base/index.jsp?ID="+ID+"')"%>" 411 418 /> 412 419 <m:menuitem 413 title=" All items"414 tooltip=" View all items that you are the owner of"420 title="<%=menu.getString("allitems.title")%>" 421 tooltip="<%=menu.getString("allitems.tooltip")%>" 415 422 onclick="<%="Menu.openUrl('"+root+"views/items/index.jsp?ID="+ID+"')"%>" 416 423 /> 417 424 <m:menuitem 418 title=" Trashcan"419 tooltip=" View all items that have been marked for deletion"425 title="<%=menu.getString("trashcan.title")%>" 426 tooltip="<%=menu.getString("trashcan.tooltip")%>" 420 427 onclick="<%="Menu.openUrl('"+root+"views/trashcan/index.jsp?ID="+ID+"')"%>" 421 428 /> 422 429 <m:menuseparator /> 423 430 <m:menuitem 424 title=" Files"431 title="<%=common.getString("item.files")%>" 425 432 onclick="<%="Menu.openUrl('"+root+"filemanager/index.jsp?ID="+ID+"')"%>" 426 tooltip="<%= hasFiles ? "Manage files" : "You do not have permission to manage files"%>"433 tooltip="<%=menu.getString("files.tooltip", hasFiles)%>" 427 434 enabled="<%=hasFiles%>" 428 435 /> 429 436 <m:menuitem 430 title=" File servers"437 title="<%=common.getString("item.fileservers")%>" 431 438 onclick="<%="Menu.openUrl('"+root+"filemanager/fileservers/index.jsp?ID="+ID+"')"%>" 432 tooltip="<%= hasFileServers ? "Manage file servers" : "You do not have permission to manage file servers"%>"439 tooltip="<%=menu.getString("fileservers.tooltip", hasFileServers)%>" 433 440 enabled="<%=hasFileServers%>" 434 441 /> 435 442 <m:menuitem 436 title=" Projects"443 title="<%=common.getString("item.projects")%>" 437 444 onclick="<%="Menu.openUrl('"+root+"my_base/projects/index.jsp?ID="+ID+"')"%>" 438 tooltip=" Manage projects"445 tooltip="<%=menu.getString("projects.tooltip", hasProjects)%>" 439 446 enabled="<%=hasProjects%>" 440 447 /> 441 448 <m:menuitem 442 title=" Permission templates"449 title="<%=common.getString("item.permissiontemplates")%>" 443 450 onclick="<%="Menu.openUrl('"+root+"views/permissiontemplates/index.jsp?ID="+ID+"')"%>" 444 tooltip=" Manage permission templates"451 tooltip="<%=menu.getString("permissiontemplates.tooltip", hasPermissionTemplates)%>" 445 452 enabled="<%=hasPermissionTemplates%>" 446 453 /> 447 454 <m:menuitem 448 title=" Messages"455 title="<%=common.getString("item.messages")%>" 449 456 onclick="<%="Menu.openUrl('"+root+"my_base/messages/index.jsp?ID="+ID+"')"%>" 450 tooltip="<%= hasMessages ? "Read your messages" : "You do not have permission to read messages"%>"457 tooltip="<%=menu.getString("messages.tooltip", hasMessages)%>" 451 458 enabled="<%=hasMessages%>" 452 459 /> 453 460 <m:menuitem 454 title=" Jobs"461 title="<%=common.getString("item.jobs")%>" 455 462 onclick="<%="Menu.openUrl('"+root+"views/jobs/index.jsp?ID="+ID+"')"%>" 456 tooltip="<%= hasJobs ? "Check the status of your jobs" : "You do not have permission to access jobs"%>"463 tooltip="<%=menu.getString("jobs.tooltip", hasJobs)%>" 457 464 enabled="<%=hasJobs%>" 458 465 /> 459 466 <m:menuitem 460 title=" Sessions"467 title="<%=common.getString("item.sessions")%>" 461 468 onclick="<%="Menu.openUrl('"+root+"views/sessions/index.jsp?ID="+ID+"')"%>" 462 tooltip="<%= hasSessions ? "Check you login sessions" : "You do not have permission to access sessions"%>"469 tooltip="<%=menu.getString("sessions.tooltip", hasSessions)%>" 463 470 enabled="<%=hasSessions%>" 464 471 /> 465 472 <m:menuseparator /> 466 473 <m:menuitem 467 title=" Hybridizations"474 title="<%=common.getString("item.hybridizations")%>" 468 475 onclick="<%="Menu.openUrl('"+root+"views/hybridizations/index.jsp?ID="+ID+"')"%>" 469 tooltip="<%= hasHybridizations ? "Manage hybridizations" : "You do not have permission to manage hybridizations"%>"476 tooltip="<%=menu.getString("hybridizations.tooltip", hasHybridizations)%>" 470 477 enabled="<%=hasHybridizations%>" 471 478 /> 472 479 <m:menuitem 473 title=" Scans"480 title="<%=common.getString("item.scans")%>" 474 481 onclick="<%="Menu.openUrl('"+root+"views/scans/index.jsp?ID="+ID+"')"%>" 475 tooltip="<%= hasScans ? "Manage scans" : "You do not have permission to manage scans"%>"482 tooltip="<%=menu.getString("scans.tooltip", hasScans)%>" 476 483 enabled="<%=hasScans%>" 477 484 /> 478 485 <m:menuitem 479 title=" Raw bioassays"486 title="<%=common.getString("item.rawbioassays")%>" 480 487 onclick="<%="Menu.openUrl('"+root+"views/rawbioassays/index.jsp?ID="+ID+"')"%>" 481 tooltip="<%= hasRawBioAssays ? "Manage raw bioassays" : "You do not have permission to manage raw bioassays"%>"488 tooltip="<%=menu.getString("rawbioassays.tooltip", hasRawBioAssays)%>" 482 489 enabled="<%=hasRawBioAssays%>" 483 490 /> 484 491 <m:menuitem 485 title=" Experiments"492 title="<%=common.getString("item.experiments")%>" 486 493 onclick="<%="Menu.openUrl('"+root+"views/experiments/index.jsp?ID="+ID+"')"%>" 487 tooltip="<%= hasExperiments ? "Manage experiments" : "You do not have permission to manage experiments"%>"494 tooltip="<%=menu.getString("experiments.tooltip", hasExperiments)%>" 488 495 enabled="<%=hasExperiments%>" 489 496 /> 490 497 <m:menuitem 491 title=" Formulas"498 title="<%=common.getString("item.formulas")%>" 492 499 onclick="<%="Menu.openUrl('"+root+"views/formulas/index.jsp?ID="+ID+"')"%>" 493 tooltip="<%= hasFormulas ? "Manage formulas" : "You do not have permission to manage formulas"%>"500 tooltip="<%=menu.getString("formulas.tooltip", hasFormulas)%>" 494 501 enabled="<%=hasFormulas%>" 495 502 /> 496 503 <m:menuseparator /> 497 504 <m:menuitem 498 title=" Reporters"505 title="<%=common.getString("item.reporters")%>" 499 506 onclick="<%="Menu.openUrl('"+root+"views/reporters/index.jsp?ID="+ID+"')"%>" 500 tooltip="<%= hasReporters ? "Manage reporters" : "You do not have permission to manage reporters"%>"507 tooltip="<%=menu.getString("reporters.tooltip", hasReporters)%>" 501 508 enabled="<%=hasReporters%>" 502 509 /> 503 510 <m:menuitem 504 title=" Reporter lists"511 title="<%=common.getString("item.reporterlists")%>" 505 512 onclick="<%="Menu.openUrl('"+root+"views/reporterlists/index.jsp?ID="+ID+"')"%>" 506 tooltip="<%= hasReporterLists ? "Manage reporter lists" : "You do not have permission to manage reporter lists"%>"513 tooltip="<%=menu.getString("reporterlists.tooltip", hasReporterLists)%>" 507 514 enabled="<%=hasReporterLists%>" 508 515 /> … … 1023 1030 <m:menuitem 1024 1031 visible="<%=HTML.isValidUrl(helplink)%>" 1025 title=" Help…"1032 title="<%=menu.getString("menu.help") + "…"%>" 1026 1033 onclick="<%="window.open('"+helplink+"','Help')"%>" 1027 1034 /> 1028 1035 <m:menuitem 1029 1036 visible="<%=HTML.isValidUrl(faqlink)%>" 1030 title=" FAQ…"1037 title="<%=menu.getString("faq.title") + "…"%>" 1031 1038 onclick="<%="window.open('"+faqlink+"','FAQ')"%>" 1039 tooltip="<%=menu.getString("faq.tooltip") %>" 1032 1040 /> 1033 1041 <m:menuseparator /> 1034 1042 1035 1043 <m:menuitem 1036 title=" About…"1044 title="<%=menu.getString("about.title") + "…"%>" 1037 1045 onclick="<%="Main.openPopup('"+root+"info/about.jsp?ID="+ID+"&page=about', 'About', 500, 350)"%>" 1038 1046 /> 1039 1047 1040 1048 <m:menuitem 1041 title=" License…"1049 title="<%=menu.getString("license.title") + "…"%>" 1042 1050 onclick="<%="Main.openPopup('"+root+"info/about.jsp?ID="+ID+"&page=license', 'About', 500, 350)"%>" 1043 1044 1051 /> 1045 1052 <m:menuitem 1046 1053 visible="<%=HTML.isValidUrl(reportbuglink)%>" 1047 title=" Report a bug…"1054 title="<%=menu.getString("bugreport.title") + "…"%>" 1048 1055 onclick="<%="window.open('"+reportbuglink+"','Reportbug')"%>" 1056 tooltip="<%=menu.getString("bugreport.tooltip")%>" 1049 1057 /> 1050 1058 <m:menuseparator /> 1051 1059 <m:menuitem 1052 title="Base project site" onclick="<%="Menu.openUrl('http://base.thep.lu.se', 'basesite')"%>" 1060 title="<%=menu.getString("basesite.title") + "…"%>" 1061 onclick="<%="Menu.openUrl('http://base.thep.lu.se', 'basesite')"%>" 1062 tooltip="<%=menu.getString("basesite.tooltip")%>" 1053 1063 /> 1054 1064 </m:menu> … … 1193 1203 <m:submenu 1194 1204 subid="base" 1195 title=" BASE"1205 title="<%=menu.getString("menu.base")%>" 1196 1206 /> 1197 1207 <m:submenu 1198 1208 subid="view" 1199 title=" View"1209 title="<%=menu.getString("menu.view")%>" 1200 1210 /> 1201 1211 <m:submenu 1202 1212 subid="biolims" 1203 title=" Biomaterial LIMS"1213 title="<%=menu.getString("menu.biolims")%>" 1204 1214 /> 1205 1215 <m:submenu 1206 1216 subid="lims" 1207 title=" Array LIMS"1217 title="<%=menu.getString("menu.arraylims")%>" 1208 1218 /> 1209 1219 <m:submenu 1210 1220 subid="administrate" 1211 title=" Administrate"1221 title="<%=menu.getString("menu.administrate")%>" 1212 1222 visible="<%=hasAdministrate%>" 1213 1223 /> 1214 1224 <m:submenu 1215 1225 subid="extensions" 1216 title=" Extensions"1226 title="<%=menu.getString("menu.extensions")%>" 1217 1227 /> 1218 1228 <m:submenu 1219 1229 subid="help" 1220 title=" Help"1230 title="<%=menu.getString("menu.help")%>" 1221 1231 /> 1222 1232 </m:menu></div> … … 1233 1243 1234 1244 1235
Note: See TracChangeset
for help on using the changeset viewer.