Difference between revisions of "Languages"

From TITAN Wiki
Jump to: navigation, search
m (How to change default language?)
m
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
Titan is a multi-language script and supports all languages. Some of them are preinstalled (English, Spanish, Polish, Indonesian, Turkish, Russian, German). If you are missing some translations or your language is not preinstalled, you need to add it.
+
Titan is a multi-language script and supports all languages. Some of them are preinstalled (English, Spanish, Polish, Indonesian, Turkish, Russian, German, French, Portugese). If you are missing some translations or your language is not preinstalled, you need to add it.
  
 
== How to add new language to Titan ==
 
== How to add new language to Titan ==
 
'''''Step 1: Create new language file'''''
 
'''''Step 1: Create new language file'''''
* Decide which language you want to add and copy the ASP.NET Culture code from <nowiki>http://msdn.microsoft.co...825488%28v=cs.20%29.aspx</nowiki> . For example, if you want to add Portuguese language, your culture code is: pt-PT
+
* Decide which language you want to add and copy the ASP.NET Culture code from https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx. For example, if you want to add Portuguese language, your culture code is: pt-PT
 
* Go to App_GlobalResurces and copy L1.resx to L1.''CULTURECODE''.resx; for Portuguese it would be L1.pt-PT.resx
 
* Go to App_GlobalResurces and copy L1.resx to L1.''CULTURECODE''.resx; for Portuguese it would be L1.pt-PT.resx
 
* Open the L1.CULTURECODE.resx file with resx (XML viewer), the best would be Visual Studio Express (it's free and very useful with Titan customization) and create the translations:
 
* Open the L1.CULTURECODE.resx file with resx (XML viewer), the best would be Visual Studio Express (it's free and very useful with Titan customization) and create the translations:
Line 10: Line 10:
  
 
Complete Step 1 for all language files for all updates, e.g. U2600.resx, U3000.resx, U3500.resx, U4000.resx etc.
 
Complete Step 1 for all language files for all updates, e.g. U2600.resx, U3000.resx, U3500.resx, U4000.resx etc.
We are adding new language file with each update to keep the whole system stable. So we don't modify/edit/enlarge the files you already translated. We are adding a new file with new content. 
+
We are adding new language file with each update to keep the whole system stable. So we don't modify/edit/enlarge the files you already translated. We are adding a new file with new content. Translation is extremely easy (it looks like translating an Excel table):
 +
[[File:LanguagesTable.png|none|thumb]]
  
'''''Step 3: Add the language flag'''''
+
'''''Step 3: Add the language to Titan'''''
  
Open ~/Controls/LanguagePanel.ascx.cs file and add your culture code to the set of languages (line 19). So in our example we will change:                                             
+
Open new ticket witch such topic in Titan support system.
'''string[] languages = { "en-US", "pl-PL", "es-ES", "de-DE", "ru-RU", "id-ID" };'''
 
to                                     
 
'''string[] languages = { "en-US", "pl-PL", "es-ES", "de-DE", "ru-RU", "id-ID", "pt-PT"};'''
 
  
 
== How to add new translatable texts to Titan? ==
 
== How to add new translatable texts to Titan? ==
See https://usetitan.com/forum/yaf_postst40_HOWTO--Add-your-own-translatable-texts-images.aspx
 
 
 
'''''What do we want to achieve?'''''
 
'''''What do we want to achieve?'''''
 
- You added your own text on the page and want to make it appear in different languages like any other Titan translated texts
 
- You added your own text on the page and want to make it appear in different languages like any other Titan translated texts
Line 27: Line 23:
  
 
'''''How to do it?'''''
 
'''''How to do it?'''''
Let's assume you have your website in 2 languages: English (default) and Polish. Get your language codes from: <nowiki>http://msdn.microsoft.co...825488%28v=cs.20%29.aspx</nowiki> 
+
Let's assume you have your website in 2 languages: English (default) and Polish. Get your language codes from: https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx 
 
In our case we have: pl-PL for Polish; 
 
In our case we have: pl-PL for Polish; 
  
Line 37: Line 33:
 
[[File:Languages.png|thumb|none]]
 
[[File:Languages.png|thumb|none]]
  
'''4.''' Now open the .RESX files by Visual Studio 2012 (Express) or any other reader and add your texts:
+
'''4.''' Now open the .RESX files via Visual Studio Express or any other reader and add your texts:
 
[[File:Languages2.png|none|thumb]]
 
[[File:Languages2.png|none|thumb]]
  
Line 48: Line 44:
 
!Languages
 
!Languages
 
Resource Files (number of records)
 
Resource Files (number of records)
!style="width:78px;"|English/United States
+
!style="width:78px;"|English
 
!style="width:78px;"|Spanish
 
!style="width:78px;"|Spanish
 
!style="width:78px;"|Polish
 
!style="width:78px;"|Polish

Latest revision as of 13:14, 4 April 2018

Titan is a multi-language script and supports all languages. Some of them are preinstalled (English, Spanish, Polish, Indonesian, Turkish, Russian, German, French, Portugese). If you are missing some translations or your language is not preinstalled, you need to add it.

How to add new language to Titan

Step 1: Create new language file

  • Decide which language you want to add and copy the ASP.NET Culture code from https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx. For example, if you want to add Portuguese language, your culture code is: pt-PT
  • Go to App_GlobalResurces and copy L1.resx to L1.CULTURECODE.resx; for Portuguese it would be L1.pt-PT.resx
  • Open the L1.CULTURECODE.resx file with resx (XML viewer), the best would be Visual Studio Express (it's free and very useful with Titan customization) and create the translations:
  • Save the file

Step 2: Translate the updates

Complete Step 1 for all language files for all updates, e.g. U2600.resx, U3000.resx, U3500.resx, U4000.resx etc. We are adding new language file with each update to keep the whole system stable. So we don't modify/edit/enlarge the files you already translated. We are adding a new file with new content. Translation is extremely easy (it looks like translating an Excel table):

LanguagesTable.png

Step 3: Add the language to Titan

Open new ticket witch such topic in Titan support system.

How to add new translatable texts to Titan?

What do we want to achieve? - You added your own text on the page and want to make it appear in different languages like any other Titan translated texts - You added the image and want it to change, depending on member language option

How to do it? Let's assume you have your website in 2 languages: English (default) and Polish. Get your language codes from: https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx  In our case we have: pl-PL for Polish; 

1. Create new directory App_GlobalResources on your Titan root directory (If it's already there, e.g. you have Ultimate license pack or created it before - SKIP THIS STEP) so you have ~/App_GlobalResources folder now

2. Create 2 .resx files: L2.resx and L2.pl-PL.resx in ~/App_GlobalResources folder; Even if you somehow changed the default language from English, L2.resx (without the code) will always be English file.

3. Open the page you want to add translates to, and place the following code: <%=Resources.L2.RESCODE1 %> where RESCODE1 is unique resource code:

Languages.png

4. Now open the .RESX files via Visual Studio Express or any other reader and add your texts:

Languages2.png

Finished!

How to change default language?

Go to Admin Panel -> Website -> Settings -> Languages

Languages

Resource Files (number of records)

English Spanish Polish Indonesian Turkish Russian German French Portuguese
L1 (506)
U2502 (6)
U2600 (18)
U3000 (14)
U3500 (25)
U3501 (28)
U3900 (15)
U4000 (101)
U4001 (2)
U4100 (2)
U4200 (186)
U5001 (27)
U5002 (3)
U5003 (29)
U5004 (30)
U5005 (5)
U5006 (78)
U5007 (54)
U5008 (31)
U5009 (18)
U6000 (126)
U6002 (49)
U6003 (43)
U6004 (21)
U6005 (34)
U6006 (38)
U6007 (14)
U6008 (44)
U6009 (6)
U6010 (132)
U6011 (44)
U6012 (92)