[Xfce4-commits] <xfce4-weather-plugin:master> Summary window: Allow aligning met.no image to the left for RTL.

Harald Judt noreply at xfce.org
Sun Jan 27 20:28:01 CET 2013


Updating branch refs/heads/master
         to 3edbdd948bbc0e423cc72f15d0444b1b9d074bc0 (commit)
       from 72279eb348810180290e9b303cbec1fcc7c7c8e6 (commit)

commit 3edbdd948bbc0e423cc72f15d0444b1b9d074bc0
Author: Harald Judt <h.judt at gmx.at>
Date:   Sun Jan 27 20:19:54 2013 +0100

    Summary window: Allow aligning met.no image to the left for RTL.
    
    RTL languages like arabic or hebrew encounter a problem when translating
    the details tab: Since the image is aligned to the right, it would be
    overwritten by the text, or the text would be written over the image.
    This patch gives the translator the possibility to align the image to the
    left by providing a translatable string that is checked at runtime. If
    it is the default (LTR), then the image will be aligned to the right,
    otherwise it will be aligned to the left.
    
    Non-RTL translators can simply leave this string untranslated, or set
    it to "LTR".

 panel-plugin/weather-summary.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 052e104..c619857 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -218,7 +218,19 @@ view_scrolled_cb(GtkAdjustment *adj,
     gint x, y, x1, y1;
 
     if (sum->icon_ebox) {
-        x1 = sum->text_view->allocation.width - 191 - 15;
+        /* TRANSLATORS: This string is not visible anywhere but
+           controls the alignment of the met.no image, so usually you
+           should leave this string untouched (which means it should
+           be "LTR"). It should be changed only for right-to-left
+           languages. If you're translating to such a language, then
+           change "LTR" to "RTL" here. For LTR languages, the image
+           will be aligned to the right, and for RTL languages, the
+           image will be aligned to the left.
+        */
+        if (!strcmp(_("LTR"), "LTR"))
+            x1 = sum->text_view->allocation.width - 191 - 15;
+        else
+            x1 = -30;
         y1 = sum->text_view->requisition.height - 60 - 15;
         gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW(sum->text_view),
                                               GTK_TEXT_WINDOW_TEXT,


More information about the Xfce4-commits mailing list