Permalink
Browse files

Initial RTL languages support and farsi localization. Thanks Kamiar N…

…adimi!
  • Loading branch information...
1 parent 58628e9 commit be01e50bdc507aa266ccf86c15eb0d6e9ed59cb6 @cezarsa committed Dec 8, 2010
Showing with 800 additions and 3 deletions.
  1. +679 −0 _locales/fa_IR/messages.json
  2. +1 −0 css/base.css
  3. +72 −0 css/base_rtl.css
  4. +1 −0 css/options.css
  5. +26 −0 css/options_rtl.css
  6. +1 −1 lib/locales.js
  7. +1 −1 locales.html
  8. +19 −1 popup.html
Oops, something went wrong.
View
@@ -9,6 +9,7 @@ body {
color: black;
font-size: 10pt;
overflow: hidden;
+ direction: __MSG_@@bidi_dir__;
}
a {
View
@@ -0,0 +1,72 @@
+html, body {
+ font-family: Tahoma;
+}
+
+input {
+ font-family: Tahoma !important;
+ font-size: 11px;
+}
+
+#error {
+ direction: rtl;
+ text-align: right;
+}
+
+#warning {
+ direction: rtl;
+ text-align: right;
+}
+
+#warning .content {
+ margin-right: 10px;
+}
+
+#warning .dismiss {
+ float: left;
+}
+
+#update_tweets {
+ direction: rtl;
+}
+
+#compose_tweet_area textarea {
+ font-family: Tahoma;
+ direction: rtl;
+}
+
+#compose_tweet_area .footer input[type='button'] {
+ direction: rtl;
+}
+
+.tweet {
+ padding: 2px 22px 0px 0px;
+ text-align: right;
+}
+
+.tweet .text {
+ clear: left;
+ text-align: right !important;
+ direction: rtl !important;
+}
+
+.tweet .footer {
+ margin-right: 62px;
+ text-align: right;
+ direction: rtl;
+}
+
+.tweet img.profile {
+ margin-left: 10px;
+ float: right;
+}
+
+.tweet img.profile.retweet_source {
+ margin-right: 4px;
+}
+
+.tweet img.profile.retweet_retweeter {
+ margin-right: 0px;
+ margin-left: -20px;
+ left: 0px;
+ right: -27px;
+}
View
@@ -4,6 +4,7 @@ body {
padding: 0px;
color: black;
font-size: 10pt;
+ direction: __MSG_@@bidi_dir__;
}
fieldset {
View
@@ -0,0 +1,26 @@
+body {
+ font-family: Tahoma;
+ line-height: 1.5;
+}
+
+h1 {
+ text-align: center;
+ font-family: "Times New Roman";
+}
+
+fieldset legend {
+ font-size: 15px;
+ font-family: Arial;
+}
+
+#main_area label {
+ float: right;
+}
+
+#main_area input[type="text"], #main_area input[type="password"], #main_area select {
+ font-family: Tahoma;
+}
+
+input {
+ font-family: Tahoma;
+}
View
@@ -90,7 +90,7 @@ LocaleTable.prototype = {
LocaleTable.availableLocaleCodes = ["am", "ar", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "en_GB", "en_US", "es",
"es_419", "et", "fi", "fil", "fr", "gu", "he", "hi", "hr", "hu", "id", "it", "ja", "kn", "ko", "lt", "lv",
"ml", "mr", "nb", "nl", "or", "pl", "pt", "pt_BR", "pt_PT", "ro", "ru", "sk", "sl", "sr", "sv", "sw",
- "ta", "te", "th", "tr", "uk", "vi", "zh", "zh_CN", "zh_TW"];
+ "ta", "te", "th", "tr", "uk", "vi", "zh", "zh_CN", "zh_TW", "fa_IR"];
var Util = {
ajax: function(callback, url) {
View
@@ -142,7 +142,7 @@
LocaleTable.availableLocaleCodes = ["am", "ar", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "en_GB", "en_US", "es",
"es_419", "et", "fi", "fil", "fr", "gu", "he", "hi", "hr", "hu", "id", "it", "ja", "kn", "ko", "lt", "lv",
"ml", "mr", "nb", "nl", "or", "pl", "pt", "pt_BR", "pt_PT", "ro", "ru", "sk", "sl", "sr", "sv", "sw",
- "ta", "te", "th", "tr", "uk", "vi", "zh", "zh_CN", "zh_TW"];
+ "ta", "te", "th", "tr", "uk", "vi", "zh", "zh_CN", "zh_TW", "fa_IR"];
var Util = {
ajax: function(callback, url) {
View
@@ -156,11 +156,29 @@
var ThemeManager = {
init: function () {
$("link.theme").remove();
+ var baseStyle = $("#base_stylesheet")[0];
+
+ var direction = 'ltr';
+ try {
+ var newDefaultLocale = OptionsBackend.get('default_locale');
+ if(newDefaultLocale == 'fa_IR') {
+ direction = 'rtl';
+ baseStyle.sheet.cssRules[1].style.direction = 'rtl';
+ } else {
+ direction = baseStyle.sheet.cssRules[1].style.direction;
+ baseStyle.sheet.cssRules[1].style.direction = '';
+ }
+ } catch(e) {}
+ if(direction == 'rtl') {
+ baseStyle.sheet.cssRules[1].style.direction
+ $("<link rel='stylesheet' type='text/css' href='css/base_rtl.css'>").appendTo(document.head);
+ }
+
var theme = OptionsBackend.get('theme');
$(theme.split(",")).each(function(i, p) {
$("<link rel='stylesheet' type='text/css' class='theme' href='" + p + "'>").appendTo(document.head);
});
- var baseStyle = $("#base_stylesheet")[0];
+
if(baseStyle.sheet && baseStyle.sheet.cssRules) {
var baseRules = baseStyle.sheet.cssRules;
var fontFamily = OptionsBackend.get('font_family');

0 comments on commit be01e50

Please sign in to comment.