Farsi translation and xepersian.sty support

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@106 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2011-05-09 13:47:46 +00:00
parent bc9545dbb1
commit f7dd0f8085
19 changed files with 398 additions and 55 deletions

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2011-03-21)
* Version 1.2 (2011-05-09)
*
*/
@ -249,7 +249,13 @@ public class Converter extends ConverterBase {
// Set locale to document language
StyleWithProperties style = ofr.isSpreadsheet() ? ofr.getDefaultCellStyle() : ofr.getDefaultParStyle();
if (style!=null) {
l10n.setLocale(style.getProperty(XMLString.FO_LANGUAGE), style.getProperty(XMLString.FO_COUNTRY));
// The only CTL language recognized currently is farsi
if ("fa".equals(style.getProperty(XMLString.STYLE_LANGUAGE_COMPLEX))) {
l10n.setLocale("fa", "IR");
}
else {
l10n.setLocale(style.getProperty(XMLString.FO_LANGUAGE), style.getProperty(XMLString.FO_COUNTRY));
}
}
// Set the main content width

View file

@ -279,6 +279,20 @@ public class L10n {
case DOCUMENT: return "Document";
}
}
if (sLocale.startsWith("fa")) { // Farsi
switch (nString) {
case UP: return "\u0628\u0627\u0644\u0627";
case FIRST : return "\u0627\u0648\u0644";
case PREVIOUS : return "\u0642\u0628\u0644\u06cc";
case NEXT : return "\u0628\u0639\u062f\u06cc";
case LAST : return "\u0627\u062e\u0631\u06cc\u0646";
//case CONTENTS : return "??";
case INDEX : return "\u0641\u0647\u0631\u0633\u062a";
case HOME : return "\u062e\u0627\u0646\u0647";
case DIRECTORY: return "\u067e\u0648\u0634\u0647";
case DOCUMENT: return "\u0645\u0633\u062a\u0646\u062f";
}
}
// English - default
switch (nString) {
case UP: return "Up";