John Levon wrote:

> On Fri, Apr 26, 2002 at 05:09:41PM +0200, Herbert Voss wrote:
> 
> 
>>this text is saved in the lyxfile. if you want them translated than
>>you have to edit the apply function, too.
>>
> 
> Like to make a patch then ?


please test

Herbert



-- 
http://www.lyx.org/help/
Index: src/frontends/controllers/ControlGraphics.C
===================================================================
RCS file: 
/usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlGraphics.C,v
retrieving revision 1.34
diff -u -r1.34 ControlGraphics.C
--- src/frontends/controllers/ControlGraphics.C 19 Apr 2002 09:17:05 -0000      1.34
+++ src/frontends/controllers/ControlGraphics.C 26 Apr 2002 16:45:16 -0000
@@ -97,7 +97,13 @@
        return answer;
 }
 
-}
+vector<string> rotateOrigin = getVectorFromString(
+       "center,"
+       "leftTop,leftBottom,leftBaseline,"
+       "centerTop,centerBottom,centerBaseline,"
+       "rightTop,rightBottom,rightBaseline");
+
+} // anon
 
  
 ControlGraphics::ControlGraphics(LyXView & lv, Dialogs & d)
@@ -181,3 +187,19 @@
        string const name = MakeAbsPath(fname, lv_.buffer()->filePath());
        return IsFileReadable(name);
 }
+
+int ControlGraphics::getOriginChoiceNo(string const orig) 
+{
+       for (unsigned int count = 0; count < ::rotateOrigin.size(); count++)
+               if (::rotateOrigin[count] == orig) 
+                       return ++count;
+       // no valid origin found, return the first entry
+       return 1;
+}
+
+
+string const ControlGraphics::getOriginChoiceText(int no) 
+{
+       return ::rotateOrigin[no];
+}
+
Index: src/frontends/controllers/ControlGraphics.h
===================================================================
RCS file: 
/usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlGraphics.h,v
retrieving revision 1.9
diff -u -r1.9 ControlGraphics.h
--- src/frontends/controllers/ControlGraphics.h 22 Mar 2002 15:24:31 -0000      1.9
+++ src/frontends/controllers/ControlGraphics.h 26 Apr 2002 16:45:16 -0000
@@ -42,6 +42,10 @@
        bool bbChanged;
        /// test if file exist
        bool isFilenameValid(string const & fname) const;
+       /// get choice_no of rotateOrigin
+       int getOriginChoiceNo(string const orig);
+       /// same vice versa
+       string const getOriginChoiceText(int no);
 private:
        /// Dispatch the changed parameters to the kernel.
        virtual void applyParamsToInset();
Index: src/frontends/xforms/FormGraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormGraphics.C,v
retrieving revision 1.69
diff -u -r1.69 FormGraphics.C
--- src/frontends/xforms/FormGraphics.C 11 Apr 2002 18:39:17 -0000      1.69
+++ src/frontends/xforms/FormGraphics.C 26 Apr 2002 16:45:17 -0000
@@ -39,6 +39,13 @@
 int const FILENAME_MAXCHARS = 1024;
 string defaultUnit("cm");
 
+// for translations
+string const choice_origin =
+       _("center|"                             // c
+       "leftTop|leftBottom|leftBaseline|"      // lt lb lB
+       "centerTop|centerBottom|centerBaseline|"// ct cb cB
+       "rightTop|rightBottom|rightBaseline");  // rt rb rB
+
 /// Given input and choice widgets, create a LyXLength
 LyXLength getLyXLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice)
 {
@@ -212,7 +219,9 @@
                }
        }
        if (fl_get_choice(file_->choice_origin) > 0)
-               igp.rotateOrigin = fl_get_choice_text(file_->choice_origin);
+               igp.rotateOrigin = 
+                       controller().getOriginChoiceText(
+                               fl_get_choice(file_->choice_origin)-1);
        else
                igp.rotateOrigin = string();
        igp.draft = fl_get_button(file_->check_draft);
@@ -313,7 +322,8 @@
        if (igp.rotateOrigin.empty())
                fl_set_choice(file_->choice_origin,1);
        else
-               fl_set_choice_text(file_->choice_origin,igp.rotateOrigin.c_str());
+               fl_set_choice(file_->choice_origin,
+                       controller().getOriginChoiceNo(igp.rotateOrigin));
        setEnabled(file_->input_rotate_angle,
                   fl_get_button(file_->check_rotate));
        setEnabled(file_->choice_origin,

Reply via email to