UniTime / unitime

Comprehensive University Timetabling System
http://www.unitime.org
Apache License 2.0
274 stars 162 forks source link

Translating Vietnamese #159

Closed Animeakihabara closed 10 months ago

Animeakihabara commented 10 months ago

I want to build unitime in Vietnamese, I am using POEdit to make translation, export as *.po and save to unitime/Documentation/Translators, after that I re-build, paste into the tomcat, shutdown and startup again tomcat and it still not working with my translate version. Notes: I already update in ./JavaSource/org/unitime/timetable/gwt/UniTime.gwt.xml

So, are there anything wrong in my step?

*Update, when I try again in many different ways, I got some changes when using: http://localhost:8080/UniTime/login.do?locale=vi

a few words are translated into Vietnamese

Screen Shot 2023-11-06 at 19 23 10

This is also my .po file in Vietnamese

Screen Shot 2023-11-06 at 19 24 56
tomas-muller commented 10 months ago

You can make the UniTime build with the Vietnamese translations using

ant -Dlocale=vi import-translations build

This will

  1. download the Vietnamese translations from poeditor.com and put them at Documentation/Translations/UniTime4.8_vi.po
  2. import the translations; note that this add vi locale in JavaSource/org/unitime/timetable/gwt/UniTime.gwt.xml, but also create JavaSource/org/unitime/localization/messages/ConstantsMessages_vi.properties and JavaSource/org/unitime/localization/messages/CourseMessages_vi.properties (and perhaps some others, depending on what messages have been already translated)
  3. make a unitime build; the resultant war file is at Distributions/UniTime.war

Since you have downloaded the UniTime4.8_vi.po and updated UniTime.gwt.xml manually, my guess is that you have missed the creation of the *_vi.properties files (UniTime does not use the .po files directly, but the properties, like ConstantsMessages_cs.properties. This can also be done by calling ant -Dlocale=vi -Ddownload=false import-translations. The properties file would look like this; example from JavaSource/org/unitime/localization/messages/CourseMessages_vi.properties:

# Default: Instructor Assignment Preferences
actionEditClassInstructorAssignmentPreferences=Tu\u1EF3 ch\u1ECDn gi\u1EA3ng vi\u00EAn cho bu\u1ED5i h\u1ECDc

# Default: Edit Assignment Preferences
actionEditInstructorAssignmentPreferences=Thay \u0111\u1ED5i tu\u1EF3 ch\u1ECDn bu\u1ED5i h\u1ECDc

# Default: Instructor Assignment Preferences
actionEditSubpartInstructorAssignmentPreferences=Tu\u1EF3 ch\u1ECDn gi\u1EA3ng vi\u00EAn cho bu\u1ED5i h\u1ECDc

# Default: Do you want to remove any instructor preferences \nthat may have been applied to this class?
confirmRemoveInstructorPreferencesFromClass=B\u1EA1n c\u00F3 mu\u1ED1n lo\u1EA1i b\u1ECF t\u1EA5t c\u1EA3 gi\u1EA3ng vi\u00EAn cho l\u1EDBp n\u00E0y?

Also, please note that the Examination Periods preferences from the screenshot are using the GWT-Const:examPeriodDateFormat property that contains a pattern (defaults to EEE MM/dd) for that the SimpleDateFormat class to use and provide localized date and time pattern strings.

But for instance, you should be able to see the translated All Classes description when adding a new distribution constraint (Courses > Input Data > Distribution Preferences, when Add Distribution Preference is clicked and the Structure: All Classes selected)

Screenshot 2023-11-06 at 16 00 56