Custom Terms and Localization: Difference between revisions

From UmsWiki
Jump to navigation Jump to search
Kpe (talk | contribs)
Samplefile update
 
(21 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Custom Terms and Localization is the first step in allowing you to alter the text that is displayed anywhere in the app.
Custom Terms and Localization is the first step in allowing you to alter the text that is displayed anywhere in the app. The edit can be made to supported languages or unsupported languages as long as phones support the culture code.


==Prerequisites==
==Prerequisites==
Line 9: Line 9:
You must create a file for each language you want to create your own translations for.
You must create a file for each language you want to create your own translations for.


This file must be saved in your root web folder (generally located at 'C:\inetpub\wwwroot'), under the subfolder of \App\Localization\Translations.*culture*.xml
[[File:Translationfiles.png|frameless|800x800px]]
 
 
 
This file must be saved in your root web folder (generally located at 'C:\inetpub\wwwroot'), under the subfolder
 
For App
\CustomStyle\Localization\'''App'''\Translations.*culture*.xml
For Web
\CustomStyle\Localization\'''Web'''\Translations.*culture*.xml
 
For Guardian
\CustomStyle\Localization\Translations.*culture*.xml


You need to create the Localization subdirectory if it does not exist. Example:
You need to create the Localization subdirectory if it does not exist. Example:
  C:\inetpub\wwwroot\App\Localization\Translations.DK.xml
  C:\inetpub\wwwroot\CustomStyle\Localization\App\Translations.da-DK.xml
If you're using [[Configurator/IniFiles#Name|IniFiles]] then the translations files must be prefixed with the name value and a _ for each customer.
C:\inetpub\wwwroot\CustomStyle\Localization\App\<IniFilesName>_Translations.da-DK.xml
 
Note: While technically you can call the culture anything (for example Translations.arbitraryname.xml), it is recommended to call it the same culture as you use inside the XML file, for easier overview. The name simply needs to follow the pattern of 'Translations.*.xml'
Note: While technically you can call the culture anything (for example Translations.arbitraryname.xml), it is recommended to call it the same culture as you use inside the XML file, for easier overview. The name simply needs to follow the pattern of 'Translations.*.xml'


A Translation file always needs a root element called 'root'. This root element needs a single attribute called 'culture', with the value of the chosen culture.
A Translation file always needs a root element called 'root'. This root element needs a single attribute called 'culture', with the value of the chosen culture.
Line 23: Line 36:
*'da-DK' (Danish)
*'da-DK' (Danish)
*'en-US' (English)
*'en-US' (English)
*'nb' (Norwegian)
*'nb_NO' (Norwegian)
*'de-DE' (German)


*'fo-FO' (Faroese)
Custom cultures(such as en-AU or en-GB or es-ES) are possible, but we do not support them.


The root element must contain an 'entry' element for each translated key you want to override. The key attribute must match the key used in UMS App.
The assigned culture needs to be usable by phones, i.e. if your phone cannot select Greenlandic or other languages with a small population, you may have to override another language, say English or Danish.
 
The root element must contain an 'entry' element for each translated key you want to override. The key attribute must match the key used in UMS.


Inside this element you can write your desired text. Note that this text will have all leading and trailing whitespaces removed.
Inside this element you can write your desired text. Note that this text will have all leading and trailing whitespaces removed.


===Sample file===
===Sample file===
<code><nowiki><div style="text-align: right; direction: ltr; margin-left: 1em;"></nowiki></code>
An example where "Student" has been replaced with "Pupil" in all strings formerly using "student" and "Homework" has been replaced with "Betterments".
<root culture="en-US">
<entry key="StudentCardViewModelEmptyStateMessage">Couldn't find your Pupil ID. If the problem persists, contact your IT department</entry>
<entry key="StudentCardViewModelTitle">Pupil ID</entry>
        <entry key="StudentNumberHeader">Pupil number</entry>
<entry key="StudentIdHeader">Pupil ID</entry>
<entry key="MenuStudentCard">Pupil ID</entry>
<entry key="AddNoteTapPersonTip">Tap on a Pupil to add a note to them.</entry>
<entry key="InvalidSelectedBarcodeFormat">The Pupil ID number cannot be displayed in the selected format. Use a different bar code format</entry>
<entry key="InvalidDefaultBarcodeFormat">This Pupil ID number cannot be displayed in the default barcode format. Contact your school</entry>
<entry key="IncludeFutureStudents">Include future pupils</entry>
<entry key="AbsenceRegistrationHowToMark">How do you want to mark pupils?</entry>
<entry key="HomeworkUpdateViewModelEmptyStateMessage">Couldn't find your betterments</entry>
<entry key="HomeworkViewModelEmptyStateMessage">Couldn't find your betterments</entry>
<entry key="HomeworkUpdateViewModelTitle">Betterments</entry>
<entry key="HomeworkViewModelTitle">Betterments</entry>
<entry key="MenuHomework">Betterments</entry>
<entry key="HomeworkItemViewModelTitle">Betterments</entry>
<entry key="HomeworkItemViewModelEmptyStateMessage">Couldn't find your Betterments</entry>
</root>
<root culture="da-DK">
    <entry key="StudentNumberHeader">Studie nummer</entry>
    <entry key="DateHeader">Sidst fornyet</entry>
    <entry key="BirthdayHeader">Fødselsdato</entry>
    <entry key="ExpiryDateHeader">Udløber d.</entry>
</root>


<code><root culture="en-US"></code>
=== APP ===
Full list of as of 23/01-2024:


<code><!-- Student to pupil replace --></code>
https://downloads.inlogic.dk/downloads/App/AppStrings.xml


<code><entry key="StudentCardViewModelEmptyStateMessage">Couldn't find your Pupil ID. If the problem persists, contact your IT department</entry></code>
For a full list of current key strings contact inLogic support.


<code><entry key="StudentCardViewModelTitle">Pupil ID</entry></code>
=== Web ===


<code><entry key="StudentNumberHeader">Pupil number</entry></code>
==== Absence ====
You can control the absence strings like this.


<code><entry key="StudentIdHeader">Pupil ID</entry></code>
<entry key="present_label">Present</entry>
<entry key="late_label">Late</entry>
<entry key="legal_label">Legal</entry>
<entry key="illegal_label">Illegal</entry>


<code><entry key="MenuStudentCard">Pupil ID</entry></code>
==== Student to ? ====
<entry key="students">Student</entry>
<entry key="click_to_show_details_for_this_student">Click to show details for this student...</entry>


<code><entry key="AddNoteTapPersonTip">Tap on a Pupil to add a note to them.</entry></code>
=== Guardian ===


<code><entry key="InvalidSelectedBarcodeFormat">The Pupil ID number cannot be displayed in the selected format. Use a different bar code format</entry></code>
==== Absence ====
You can control the absence strings like this.


<code><entry key="InvalidDefaultBarcodeFormat">This Pupil ID number cannot be displayed in the default barcode format. Contact your school</entry></code>
<entry key="present_label">Present</entry>
 
<entry key="late_label">Late</entry>
<code><entry key="SmsSendSelectedStudentsMessage">You have selected {count, plural, =1 {1 pupil} other {# pupils} }</entry></code>
<entry key="legal_label">Legal</entry>
 
  <entry key="illegal_label">Illegal</entry>
<code><entry key="IncludeFutureStudents">Include future pupils</entry></code>
 
<code><entry key="SmsSendAsSms">Will be sent as text to {pupils, plural, =1 {1 pupil} other {# pupils} }.</entry></code>
 
<code><entry key="SmsSendAsMail">Will be sent as e-mail to {pupils, plural, =1 {1 pupil} other {# pupils} }.</entry></code>
 
<code><entry key="SmsCannotSend">Cannot be sent to {pupils, plural, =1 {1 pupil} other {# pupils} }.</entry></code>
 
<code><entry key="AbsenceRegistrationHowToMark">How do you want to mark pupils?</entry></code>
 
<code><entry key="TimeDetailNoteStudent">pupil: {0}</entry></code>
 
<code><!-- Homework to Betterments replace --></code>
 
<code><entry key="HomeworkUpdateViewModelEmptyStateMessage">Couldn't find your betterments</entry></code>
 
<code><entry key="HomeworkViewModelEmptyStateMessage">Couldn't find your betterments</entry></code>
 
<code><entry key="HomeworkUpdateViewModelTitle">Betterments</entry></code>
 
<code><entry key="HomeworkViewModelTitle">Betterments</entry></code>
 
<code><entry key="MenuHomework">Betterments</entry></code>
 
<code><entry key="HomeworkItemViewModelTitle">Betterments</entry></code>
 
<code><entry key="HomeworkItemViewModelEmptyStateMessage">Couldn't find your Betterments</entry></code>
 
<code></root></code>
 
<code><nowiki></div></nowiki></code>
 
 
  <root culture="da-DK">
    <entry key="StudentNumberHeader">Studie nummer</entry>
    <entry key="DateHeader">Sidst fornyet</entry>
    <entry key="BirthdayHeader">Fødselsdato</entry>
    <entry key="ExpiryDateHeader">Udløber d.</entry>
</root>


==FAQ==
==FAQ==


*''The translations are not getting loaded''
==== Where can i find standard language strings not listed in my translation file. ====
There is a file under App_GlobalResources called Site.resx where you can see most of UMS language strings.


==== ''The translations are not getting loaded'' ====
Check the Event Viewer, if anything is wrong with the XML structure, it will write an error entry here.
Check the Event Viewer, if anything is wrong with the XML structure, it will write an error entry here.


*''The app is not using the translations''
==== ''The app is not using the translations'' ====
 
These translations are only updated once a day, as well as on log in/out.
These translations are only updated once aday, as well as on log in/out.


Please note that the app requires a minimum of version '''3.2.0'''
Please note that the app requires a minimum of version '''3.2.0'''


*''Letters like Æ, Ø and Å are shown incorrectly''
==== ''Letters like Æ, Ø and Å are shown incorrectly'' ====
 
Make sure when you save the XML file, that you save it as Unicode encoding. While other types of encoding may work, Unicode has been confirmed to work with all Scandinavian letters
Make sure when you save the XML file, that you save it as Unicode encoding. While other types of encoding may work, Unicode has been confirmed to work with all Scandinavian letters

Latest revision as of 08:22, 5 February 2025

Custom Terms and Localization is the first step in allowing you to alter the text that is displayed anywhere in the app. The edit can be made to supported languages or unsupported languages as long as phones support the culture code.

Prerequisites

  • UMS Web
  • Basic understanding of XML

Getting started

You must create a file for each language you want to create your own translations for.


This file must be saved in your root web folder (generally located at 'C:\inetpub\wwwroot'), under the subfolder

For App

\CustomStyle\Localization\App\Translations.*culture*.xml

For Web

\CustomStyle\Localization\Web\Translations.*culture*.xml

For Guardian

\CustomStyle\Localization\Translations.*culture*.xml

You need to create the Localization subdirectory if it does not exist. Example:

C:\inetpub\wwwroot\CustomStyle\Localization\App\Translations.da-DK.xml

If you're using IniFiles then the translations files must be prefixed with the name value and a _ for each customer.

C:\inetpub\wwwroot\CustomStyle\Localization\App\<IniFilesName>_Translations.da-DK.xml

Note: While technically you can call the culture anything (for example Translations.arbitraryname.xml), it is recommended to call it the same culture as you use inside the XML file, for easier overview. The name simply needs to follow the pattern of 'Translations.*.xml'

A Translation file always needs a root element called 'root'. This root element needs a single attribute called 'culture', with the value of the chosen culture.

Supported cultures are

  • 'da-DK' (Danish)
  • 'en-US' (English)
  • 'nb_NO' (Norwegian)
  • 'de-DE' (German)

Custom cultures(such as en-AU or en-GB or es-ES) are possible, but we do not support them.

The assigned culture needs to be usable by phones, i.e. if your phone cannot select Greenlandic or other languages with a small population, you may have to override another language, say English or Danish.

The root element must contain an 'entry' element for each translated key you want to override. The key attribute must match the key used in UMS.

Inside this element you can write your desired text. Note that this text will have all leading and trailing whitespaces removed.

Sample file

An example where "Student" has been replaced with "Pupil" in all strings formerly using "student" and "Homework" has been replaced with "Betterments".

<root culture="en-US">
	<entry key="StudentCardViewModelEmptyStateMessage">Couldn't find your Pupil ID. If the problem persists, contact your IT department</entry>
	<entry key="StudentCardViewModelTitle">Pupil ID</entry>
        <entry key="StudentNumberHeader">Pupil number</entry>
	<entry key="StudentIdHeader">Pupil ID</entry>
	<entry key="MenuStudentCard">Pupil ID</entry>
	<entry key="AddNoteTapPersonTip">Tap on a Pupil to add a note to them.</entry>
	<entry key="InvalidSelectedBarcodeFormat">The Pupil ID number cannot be displayed in the selected format. Use a different bar code format</entry>
	<entry key="InvalidDefaultBarcodeFormat">This Pupil ID number cannot be displayed in the default barcode format. Contact your school</entry>
	<entry key="IncludeFutureStudents">Include future pupils</entry>
	<entry key="AbsenceRegistrationHowToMark">How do you want to mark pupils?</entry>
	<entry key="HomeworkUpdateViewModelEmptyStateMessage">Couldn't find your betterments</entry>
	<entry key="HomeworkViewModelEmptyStateMessage">Couldn't find your betterments</entry> 
	<entry key="HomeworkUpdateViewModelTitle">Betterments</entry>
	<entry key="HomeworkViewModelTitle">Betterments</entry>
	<entry key="MenuHomework">Betterments</entry>
	<entry key="HomeworkItemViewModelTitle">Betterments</entry>
	<entry key="HomeworkItemViewModelEmptyStateMessage">Couldn't find your Betterments</entry>
</root>


<root culture="da-DK">
    <entry key="StudentNumberHeader">Studie nummer</entry>
    <entry key="DateHeader">Sidst fornyet</entry>
    <entry key="BirthdayHeader">Fødselsdato</entry>
    <entry key="ExpiryDateHeader">Udløber d.</entry>
</root>

APP

Full list of as of 23/01-2024:

https://downloads.inlogic.dk/downloads/App/AppStrings.xml

For a full list of current key strings contact inLogic support.

Web

Absence

You can control the absence strings like this.

<entry key="present_label">Present</entry>
<entry key="late_label">Late</entry>
<entry key="legal_label">Legal</entry>
<entry key="illegal_label">Illegal</entry>

Student to ?

<entry key="students">Student</entry>
<entry key="click_to_show_details_for_this_student">Click to show details for this student...</entry>

Guardian

Absence

You can control the absence strings like this.

<entry key="present_label">Present</entry>
<entry key="late_label">Late</entry>
<entry key="legal_label">Legal</entry>
<entry key="illegal_label">Illegal</entry>

FAQ

Where can i find standard language strings not listed in my translation file.

There is a file under App_GlobalResources called Site.resx where you can see most of UMS language strings.

The translations are not getting loaded

Check the Event Viewer, if anything is wrong with the XML structure, it will write an error entry here.

The app is not using the translations

These translations are only updated once a day, as well as on log in/out.

Please note that the app requires a minimum of version 3.2.0

Letters like Æ, Ø and Å are shown incorrectly

Make sure when you save the XML file, that you save it as Unicode encoding. While other types of encoding may work, Unicode has been confirmed to work with all Scandinavian letters