Is it possible to translate the template?

Mar 6, 2007 at 8:42 AM
Hello,
I would want to know if it is possible to translate your template in french, and if it is possible what is the best way to do that?
Thanks
Yvan.
Coordinator
Mar 7, 2007 at 9:09 AM
To translate the CKS:UGE to French, try using the .STP site template to create a site on a SharePoint server that has the French Language Pack installed. All of the text currently in English should be translatable. Once everything has been translated, save the site as an .STP site template. Voila! A French version of the CKS:UGE!
Mar 8, 2007 at 8:22 PM
Thank you but I'm not sure to understand.
I think there is a way to automatically translate the SharePoint localized text (like the text in the quick launch bar for example) but I'm not sure that it is possible and if it is I don't know how to do (it probably just necessit to change the LCID from 1033 to 1036 in the template but I'm not sure that it is possible).
After this I will just need to translate the specific text of the template.
Thanks for your help.
Yvan.
Coordinator
Mar 20, 2007 at 11:31 PM
Edited Mar 20, 2007 at 11:31 PM
SharePoint has language packs available for various languages. Go to http://blogs.msdn.com/sharepoint/archive/tags/Language+Packs/default.aspx for more info. The LPs also include localized versions of the OOTB site templates. I had thought that you could create a non-English site using the CKS:UGE, but I just tried it without success. It appears that an .STP created in one language can only be used to create sites in that same language. So, in order to localize the CKS:UGE in French, for instance, you would have to create a blank site using the OOTB French "Blank Site" template, manually customize it to match the design and content of the English CKS:UGE, and save the site as an .STP.



yboris wrote:
Thank you but I'm not sure to understand.
I think there is a way to automatically translate the SharePoint localized text (like the text in the quick launch bar for example) but I'm not sure that it is possible and if it is I don't know how to do (it probably just necessit to change the LCID from 1033 to 1036 in the template but I'm not sure that it is possible).
After this I will just need to translate the specific text of the template.
Thanks for your help.
Yvan.


Mar 21, 2007 at 11:32 AM
Thak you very much,
I was afraid of this answer but it confirms my doubts
As you said a .STP template is probably linked to one language and I don't know if it is possible to change the language code (LCID) in a template.
Coordinator
Apr 2, 2007 at 5:27 PM
I just found this: http://blog.sharepoint-factory.net/article/3424605.html. While I can’t read Japanese, I can tell from the screenshots that this tool will convert (hack?) an .STP created in English (or any language) to any other language, so the resultant .STP can be used to create a site in that language. Thereafter, the content can be localized. The process should be a lot faster and more accurate than having to recreate the .STP from scratch. I cannot vouch for whether this method of localizing an .STP file will be supported by Microsoft (I strongly doubt it), but you might want to give it a try anyway just for "educational purposes." :-)


yboris wrote:
Thak you very much,
I was afraid of this answer but it confirms my doubts
As you said a .STP template is probably linked to one language and I don't know if it is possible to change the language code (LCID) in a template.


Coordinator
Apr 5, 2007 at 1:28 AM
this was a post on solshare.net about localizing webparts:

The .NET Framework uses a hub and spoke model to package and deploy resources. The hub is the main assembly that contains the non-localizable executable code and the resources for a single culture, called the neutral or default culture. The default culture is the fallback culture for the application. Each spoke connects to a satellite assembly that contains the resources for a single culture, but does not contain any code.


Depending on the locale or language settings under which the main assembly is operating the appropriate satellite assembly, if available, will be loaded by the .Net runtime and it's localized resources displayed within the program. For example, the .Net runtime will seek resources from an Arabic satellite assembly when running sites provisioned from Arabic site templates. If no such Arabic site template exists the default resource files built into the application will be used.


English is the default culture for the SSN web parts, therefore by default the labels, Tool Pane properties, and default text display in English. Satellite assemblies give the SSN web parts the ability to display labels, Tool Pane properties, and default text in languages other than English.


Important: In addition to the satellite assemblies SharePoint requires installation of language packs for multi-language support.


The steps for building and deploying a satellite assembly are as follows:


1) Create a new resource (.resx) file from the default resource (.resx) file. Note: .resx files are in xml plain text format.

2) Make the necessary language modifications to the new resource file.

3) Use the .Net Resource File Generator (Resgen.exe) tool to convert the newly created xml resource file into a binary (.resources) file.

4) Use the .Net Assembly Linker (Al.exe) tool to embed one or more binary resource files into a satellite assembly.

5) Install the satellite assembly into the GAC on the SharePoint server.


Note: Steps 1 and 2 above can be performed using any text editor such as Notepad.


Detailed below are the steps to build a German satellite assembly for the SSN GeneralStats web part. By changing the language code (“de” in this example) to that of other language codes and altering the language text (in the .resx file) accordingly these steps can be applied to build satellite assemblies for any language.

Refer to the following link for available language codes: http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx


1) Copy and paste the entire contents of the default GeneralStats resource file (GeneralStats.resx) into a new text file. Save the new file as GeneralStats.de.resx. The system language code “de” is used to specify this file as localized for German.



You can get the RESX files for the SSN web parts here: http://solshare.net/files/folders/ssnv3/entry524.aspx


2) Modify the contents of the data (“<data>”) elements of GeneralStats.de.resx to meet German locale requirements.


3) Run resgen.exe against the newly created GeneralStats.de.resx file.


resgen "c:\temp\GeneralStats.de.resx" "c:\temp\GeneralStats.de.resources"


Refer to the following link for details on using resgen.exe: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfResourceFileGeneratorUtilityResGenExe.asp


4) Run al.exe against the newly created GeneralStats.de.resources file.


al /embedresource:"c:\temp\ GeneralStats.de.resources "," SSN.WebControls.General.Resources.GeneralStats.de.resources" /target:lib /culture:de /keyfile:"C:\myKeyFileFolder\SSN.snk" /template:"C:\SSN\SSN.WebControls.General\bin\Release\SSN.WebControls.General.dll" /out:"c:\temp\SSN.WebControls.General.resources.dll"



Refer to the following link for details on using al.exe:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfAssemblyGenerationUtilityAlexe.asp


5) Install the newly created SSN.WebControls.General.resources.dll satellite assembly into GAC on the SharePoint server.


Refer to the following link for details on installing assemblies into the GAC: http://msdn2.microsoft.com/en-us/library/dkkx7f79.aspx


Note: After installing the satellite assembly into the GAC recycle SharePoint's IIS application pool or run iisreset. If the appropriate SharePoint language pack is installed, provisioning sites or site collections in the desired language will trigger the .Net runtime to pull in resources from the newly installed satellite assembly.

Coordinator
Apr 11, 2007 at 9:22 PM
...and here is another write up on template translation...again SSN is mentionned here, but this info is generic to any template.

1) Rename the template file to have a .cab extension
Example: SSNProjects.stp --> Rename to --> SSNProjects.cab

2) Extract all files from the cab into an empty temporary working folder.

3) Edit the manifest.xml file in any text editor (Notepad is sufficient).

4) Replace all current locale codes LCID (decimal value) with that of target language.

Warning : DO NOT simply replace all instances of current lcid with new lcid as the current lcid number may be used elsewhere in another context.

Example English to Arabic conversion:
a) Find <Language>1033</Language> replace with <Language>1025</Language>
b) Find <Locale>1033</Locale> replace with <Locale>1025</Locale>
c) Find all "1033\STS\" replace with "1025\STS\"
d) Find all "Layouts\1033\" replace with "Layouts\1025\"
e) Find all "/layouts/1033/" replace with "/layouts/1025/"

5) Replace all English locale short strings with that of target language.
Example English to Arabic conversion:
a) search & find "en-us" replace with "ar-ae".

6) Save manifest.xml

7) Create a new CAB file containing the modified manifest.xml and the other files extracted from the original cab file.
CABARC.EXE is a popular CAB file creator and is included it the Microsoft Cabinet Software Development Kit (Cabsdk.exe) which is downloadable from Microsoft at: http://support.microsoft.com/kb/310618

Here is the CABARC.EXE syntax:
CABARC.EXE N "TemplateFilePath.cab" FolderIncludesTemplatesFiles"\\.\""
Where:
TemplateFilePath is a new cab file to create.
FolderIncludesTemplatesFiles is the full path to the folder containing
the updated files extracted from the original .cab file

For example:
CABARC.EXE N myarabicsitetemplate.cab c:\tempworking_folder\\.

8) Change the new CAB file's extension from cab to stp.
Example: myarabicsitetemplate.cab --> Rename to --> myarabicsitetemplate.stp

9) Use the SharePoint utility stsadmin to add the new template to SharePoint's Template Gallery.
For example:
stsadm -o addtemplate -filename c:\temp\myarabicsite_template.stp"
-title "My New Arabic Site Template"
Note:
The Stsadm SharePoint utility usually exists in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
Verification of the newly added template can be done using the enumtemplate command.
For example: stsadm -o enumtemplates

10) Use stsadmin to create a new site collection based on the newly installed site template and it's locale ID.
For example:
stsadm -o createsite -url http://ssndev1/sites/mynewarabicsite -title "My New Arabic Site" -owneremail "admin@ssn.com" -ownerlogin "ssndev1\administrator" -sitetemplate "My New Arabic Site Template" -lcid 1025

Note:
The -lcid parameter is required when using a non-English template.
Coordinator
Apr 15, 2007 at 4:04 AM
Yes, that's a manual hack of the .STP file to change the LCID. An easier way would be to use the ".STP Language Converter" tool that's freely available at http://www.kwizcom.com/ContentPage.asp?PageId=165.
Apr 15, 2007 at 2:46 PM
Edited Apr 15, 2007 at 2:46 PM
Yes, it is free.
I just tried the software and it works well but I'm surprised that very few elements were translated (only site actions and login menu). I think left bar navigation should be translated for it is not hard coded.
Anyway, thank for your very useful help.
Coordinator
Apr 18, 2007 at 3:27 AM
The ".STP Language Converter" doesn't translate the Quick Launch navigation text. You'll need to do that manually. Same thing for any web part title text, which you'll need to manually translate by going into the Property panel of each web part.