IssueManager 3.0
IssueManager Enhanced 3.0
VCalendar

News 
Patches available in Downloads 9/5/2006

Subscribe
for notifications about new releases
(of all our apps)
Email


Wordpress themes


Design awesome Wordpress
themes & professional
Website templates.
www.Artisteer.com

Adding a New Translation to VCalendar in .NET (for FW v1.1)

Adding a New Translation to VCalendar in .NET (for FW v1.1)


  1. Copy the file "en.txt" into a new file named as <2 char language code>.txt , (for example fr.txt). See Appendix 1.
  2. Translate all values in the new file to the desired language.
  3. Compile this file using utility CCResgen.exe (CCResgen.exe fr.txt strings.fr.resources). The utility can be downloaded from http://www.vcalendar.org/site/downloads/CCResgen.zip
  4. In web.config add <locale> line â <locales> node 24 with the translated language, for example for French:
    <locale language="fr" country="" defaultCountry="US" name="en-US" booleanFormat="Yes;No;" 
    	zeroFormat="" nullFormat=""
    weekdayNarrowNames="S;M;T;W;T;F;S" encoding="utf-8" />

    See Appendices 2.

  5. Create file "fr.AssemblyInfo.vb.txt" in the project folder (you can use ru.AssemblyInfo.vb.txt as a source)

    For C# this file is called "fr.AssemblyInfo.cs.txt"

    See Appendices 3.

  6. Add the follwing lines to makeall.bat after line 8:
    @IF NOT EXIST bin\fr mkdir bin\fr
    %windir%\Microsoft.NET\Framework\v1.1.4322\vbc /target:library /out:bin\fr\calendarVB.resources.dll
    /resource:strings.fr.resources,calendarVB.strings.fr.resources fr.AssemblyInfo.vb.txt

    For C#

  7. Add the follwing lines to makeall.bat after line 8:
    @IF NOT EXIST bin\fr mkdir bin\fr
    %windir%\Microsoft.NET\Framework\v1.1.4322\csc /target:library /out:bin\fr\calendarVB.resources.dll
    /resource:strings.fr.resources,calendarVB.strings.fr.resources fr.AssemblyInfo.vb.txt

    See Appendices 4.

  8. Database changes.
    • Update the record into the config table with id=7 (default_language) to add new locale to the config_listbox field. This field's value is used to build the Locale lisboxes. See Appendix 5.
    • Add data in new languages to the following tables (xxxxx_langs): categories_langs, config_langs, contents_langs, custom_fields_langs, permissions_langs, email_templates_lang. See Appendix 6.
  9. Compile the project by running makeall.bat.

Appendix 1. Languages - ISO 639-1 alpha-2 codes

  "af"="Afrikaans"
  "sq"="Albanian"
  "ar"="Arabic"
  "hy"="Armenian"
  "eu"="Basque"
  "be"="Belarusian"
  "bg"="Bulgarian"
  "ca"="Catalan"
  "zh"="Chinese"
  "hr"="Croatian"
  "cs"="Czech"
  "da"="Danish"
  "nl"="Dutch"
  "en"="English"
  "et"="Estonian"
  "fo"="Faroese"
  "fi"="Finnish"
  "fr"="French"
  "de"="German"
  "el"="Greek"
  "he"="Hebrew"
  "hi"="Hindi"
  "hu"="Hungarian"
  "is"="Icelandic"
  "id"="Indonesian"
  "it"="Italian"
  "ja"="Japanese"
  "ko"="Korean"
  "lv"="Latvian"
  "lt"="Lithuanian"
  "mk"="Macedonian"
  "ms"="Malay"
  "mr"="Marathi"
  "nb"="Norwegian (Bokm+?l)"
  "nn"="Norwegian (Nynorsk)"
  "fa"="Persian"
  "pl"="Polish"
  "pt"="Portuguese"
  "ro"="Romanian"
  "ru"="Russian"
  "sa"="Sanskrit"
  "sk"="Slovak"
  "sl"="Slovenian"
  "es"="Spanish"
  "sw"="Swahili"
  "sv"="Swedish"
  "ta"="Tamil"
  "tt"="Tatar"
  "th"="Thai"
  "tr"="Turkish"
  "uk"="Ukrainian"
  "ur"="Urdu"
  "vi"="Vietnamese"

Appendix 2. Adding the language parameters into web.config

For French the line whould look like the following:

<locale language="fr" country="" defaultCountry="FR" name="fr-FR" booleanFormat="Oui;No;" 
zeroFormat="" nullFormat="" weekdayNarrowNames="D;L;M;M;J;V;S" encoding="utf-8" />

Appendix 3. Adding the new fr.AssemblyInfo.vb.txt file

For French the file content should be the following:

'AssemblyInfo  @0-D4CC498D
Imports System.Reflection
Imports System.Runtime.CompilerServices

<Assembly: AssemblyCulture("fr")>
'End AssemblyInfo 

Appendix 4. File makeall.bat for 3 translations

REM _MakeAll @1-BD2AC6B7
@IF "%1"=="" GOTO label
@%1
:label
@IF NOT "%2"=="" cd %2
@IF NOT EXIST bin mkdir bin 
@IF NOT EXIST bin\ru mkdir bin\ru
%windir%\Microsoft.NET\Framework\v1.1.4322\vbc /target:library 
/out:bin\ru\calendarVB.resources.dll
/resource:strings.ru.resources,calendarVB.strings.ru.resources ru.AssemblyInfo.vb.txt

@IF NOT EXIST bin\fr mkdir bin\fr
%windir%\Microsoft.NET\Framework\v1.1.4322\vbc /target:library 
/out:bin\fr\calendarVB.resources.dll
/resource:strings.fr.resources,calendarVB.strings.fr.resources fr.AssemblyInfo.vb.txt

%windir%\Microsoft.NET\Framework\v1.1.4322\vbc /rootnamespace:calendarVB  /t:library 
/debug+ /optimize- /out:bin\calendarVB.dll 
/imports:System.Data.OracleClient /r:System.Data.OracleClient.dll 
/imports:Microsoft.VisualBasic,System,System.Web,System.Xml,System.Data,System.Drawing 
/r:Microsoft.VisualBasic.dll,System.dll,System.Web.dll,System.Xml.dll,System.Data.dll,
System.Drawing.dll /recurse:*.vb 
/res:strings.resources,calendarVB.strings.resources
REM _End MakeAll

For C#

REM _MakeAll @1-4B7FF7EA
@IF "%1"=="" GOTO label
@%1
:label
@IF NOT "%2"=="" cd %2
@IF NOT EXIST bin mkdir bin 
@IF NOT EXIST bin\ru mkdir bin\ru
%windir%\Microsoft.NET\Framework\v1.1.4322\csc /target:library 
/out:bin\ru\calendar.resources.dll 
/resource:strings.ru.resources,calendar.strings.ru.resources ru.AssemblyInfo.cs.txt
@IF NOT EXIST bin\fr mkdir bin\fr
%windir%\Microsoft.NET\Framework\v1.1.4322\csc /target:library 
/out:bin\fr\calendar.resources.dll 
/resource:strings.fr.resources,calendar.strings.fr.resources fr.AssemblyInfo.cs.txt
%windir%\Microsoft.NET\Framework\v1.1.4322\csc /w:2 /t:library /debug+ /optimize- 
/out:bin\calendar.dll  
/r:System.Data.OracleClient.dll 
/r:System.dll;System.Web.dll;System.Xml.dll;System.Data.dll /recurse:*.cs 
/res:strings.resources,calendar.strings.resources
REM _End MakeAll

Appendix 5. Basic SQL for adding a new locale

Let's use French as an example. Add 'fr;French' into table 'config'.

-- Adding a new language into table config
UPDATE config SET config_listbox = 'en;English;ru;Russian;fr;French' WHERE config_id=7;

Appendix 6. Basic SQL for adding a new translation, for example French.

Change 'fr' to the translated language code, and translate all the text.

-- SQL for categories
INSERT INTO categories_langs (category_id, language_id, category_name) 
 VALUES  (1, 'fr', 'Main category');


-- SQL for config 
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',3,'Calendar Snapshot mode', 'None;Don''t show at all;Current;Show current month;
  Selected;Show selected month');
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',4,'Allow users to select a style', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',5,'Allow users to select a language', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',6,'Default Style','Basic;Basic;Blueprint;Blueprint;CoffeeBreak;CoffeeBreak;
  Compact;Compact;GreenApple;
  GreenApple;Innovation;Innovation;None;None;Pine;Pine;SandBeach;SandBeach;School;
  School');
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',7,'Default Language', 'en;English;ru;Russian;fr;French');
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',8,'Menu type', 'None;None;Vertical;Vertical;Horizontal;Horizontal');
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',9,'Page header', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',10,'Page footer', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',11,'Registration type','0;Disable registration;1;Registration without a 
  confirmation;4;New registration confirmed by E-Mail;8;New user addition requires 
  the administrator approval');
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',12,'E-Mail to be shown in the From field', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',13,'SMTP Server name', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',14,'SMTP Server port', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',15,'Display  the week icon in the year calendar', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox)
VALUES 
  ('en',16,'Show Calendar Snapshot in views', '2;Monthly, Weekly, Daily;4;Weekly,
  Daily');
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox)
VALUES 
  ('en',17,'Display the week icon in the Calendar Snapshot', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox) 
VALUES 
  ('en',18,'Open the pop-up window for the events', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox)
VALUES 
  ('en',19,'Display the navigator in the Calendar Snapshot', NULL);
INSERT INTO config_langs (language_id, config_id, config_desc, config_listbox)
VALUES 
  ('en',20,'Time Format', '1;Predefined (depends from locale);2;Military (14:20);3;
  US Standard (2:20 PM)');


-- SQL for Content 
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value)
VALUES 
  (1,'fr','Displayed for the user after registration if confiramtion by E-Mail 
  is required','<h3>{user_login}</h3>\r\n<h4>Thank you for your 
  registaration.</h4>\r\n<p>You should receive confirmation instructions
  by email shortly.</p>\r\n<p>Email was sent to {user_email}</p>');
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value) 
VALUES 
  (2,'fr','Displayed after registration if new user need admin approval',
  '<h3>{user_login}</h3>\r\n<h4>Thank you for your registaration.
  </h4>\r\n<h5>Your account must be approved by Administrator.</h5>');
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value)
VALUES 
  (3,'fr','Displayed after registration if confirmation isn''t required',
  '<h3>{user_login}</h3>\r\n<h4>Thank you for your registaration.
  </h4>');
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value)
VALUES 
  (4,'fr','Displayed after the changing password','<h3>{user_login}</h3>\r\n
  <p>Your password was changed successfully.</p>\r\n<p>
  <a href=\"profile.php\">Back to profile</a></p>');
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value)
VALUES 
  (5,'fr','Displayed for the user after verification','<h3>{user_login}
  </h3>\r\n<h2>Your account is now active.</h2>\r\n');
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value)
VALUES 
  (6,'fr','Displayed after the new password was sent','<h2>Email was sent
  </h2><p>If you supplied the correct username or email address for 
  your account,  the confirmation  will be sent to the specified email address.
  </p><p>Please check your mailbox.</p><a href=".\"
  >Back to main page</a>.</p>');
INSERT INTO contents_langs (content_id, language_id, content_desc,content_value) 
VALUES 
  (7,'fr','Displayed in the lost pasword page','<h2>Welcome, {user_login}
  </h2><p>You may now change your password.');


-- SQL for Custom fields 
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',1,'Location');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',2,'Cost');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',3,'URL');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',4,'TextBox 1');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',5,'TextBox 2');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',6,'TextBox 3');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',7,'TextArea 1');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',8,'TextArea 2');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',9,'TextArea 3');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',10,'CheckBox 1');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',11,'CheckBox 2');
INSERT INTO custom_fields_langs (language_id, field_id, field_label) VALUES
  ('fr',12,'CheckBox 3');


-- SQL for the Permissions 
INSERT INTO permissions_langs (permission_id, language_id, permission_desc) 
  VALUES (1,'fr','Who can add new events');
INSERT INTO permissions_langs (permission_id, language_id, permission_desc) 
  VALUES  (2,'fr','Who can UPDATE public events');
INSERT INTO permissions_langs (permission_id, language_id, permission_desc) 
  VALUES  (3,'fr','Who can DELETE public events');
INSERT INTO permissions_langs (permission_id, language_id, permission_desc) 
  VALUES  (4,'fr','Who can READ private events');
INSERT INTO permissions_langs (permission_id, language_id, permission_desc) 
  VALUES  (5,'fr','Who can UPDATE private events');
INSERT INTO permissions_langs (permission_id, language_id, permission_desc) 
  VALUES  (6,'fr','Who can DELETE private events');


-- SQL for the Email Templates 
INSERT INTO email_templates_lang (language_id,email_template_id,email_template_desc,
email_template_subject,email_template_body) 
 VALUES ('fr',1,'Confirmation message sent after registration.<br>Use 
 predefined tags:<br> {user_login} for login,<br>{user_email} for 
 user e-mail, <br>{date_time} for registration date,<br>{activate_url}
 for activation URL.','confirmation message','Welcome {user_login},\r\nOn
 {date_time} we''ve received a request of registration to our online calendar for 
 {user_email} email address.\r\nIf you want to confirm the registration, visit 
 {activate_url} page.\r\n\r\nIf you received this email as an error, ignore and 
 delete it.\r\n\r\nThis registration will expire in 24 hours.');
INSERT INTO email_templates_lang (language_id,email_template_id,
email_template_desc,email_template_subject,email_template_body) 
 VALUES ('fr',2,'Message sent after the administrator approval. <br>Use 
 the predefined tags:<br> {user_login} as login,<br>{site_url} as site 
 URL.','Your account was approved','Welcome {user_login},\r\n\r\nYour account  
 was approved by the administrator\r\n\r\nLink:  {site_url}.');
INSERT INTO email_templates_lang (language_id,email_template_id,email_template_desc,
email_template_subject,email_template_body) 
 VALUES ('fr',3,'Email sent to users who forgot password<br>
 Use predefined tags:<br>{activate_url} for activation URL.',
 'Forgot password','Someone (presumably you) requested a password change.
 If this was not you, ignore this message, your data will be left unchanged.
 \r\n\r\nOtherwise, please visit the following URL to change your password: 
 \r\n\r\n {activate_url}');
[print] Revised: 7/4/2006
   Visit our sponsors:
Visual PHP and Web Development, Web Reporting