cancel
Showing results for 
Search instead for 
Did you mean: 

OTR - is it reallly that simple?

Former Member
0 Kudos

Hi all..

I have seen some posts by Craig and others talking about OTR. Most of my Error messages are OTRized.. but I never tested it because we didn't have a need for that..

Now we are planning to implement multiple language support for our BSP applications and I am trying to run some Tests and unable to produce the desired results.


          CALL METHOD runtime->get_otr_text
            EXPORTING
              alias = 'ZTRACK/TEST1'
            RECEIVING
              text  = my_mesg.

The above code ( for example ) always returns the values for 'my_mesg' in English.

My question is :

1) How do I test my BSP application in .. say .. French

I have tried to log on to my WAS box in French and also tried to Activate the Service in FRENCH with no luck..

2) Do I have to make my Labels ( for example ) as texts in OTR to use it? We are talking about 100s of texts on BSP application.. such as Labels, Push buttons etc..I am hoping this code will work..


          <phtmlb:formLayoutInputField id       = "fName"
                                       pos      = "col=1"
                                       label    = "<otr>First Name :</otr>"
                                       value    = "//mdl_track/LT_USR_SRCH.ZFIRST_NAME" />

or


<OTR>
          <phtmlb:formLayoutInputField id       = "lName"
                                       pos      = "asNeighbour,tiedTo=fName, row=+1,col=1"
                                       label    = "Last Name :"
                                       value    = "//mdl_track/LT_USR_SRCH.ZLAST_NAME" />
</OTR>

needless to say .. currently neither is working..

3) Is there any kind of installation that needs to be done to be able to run OTR on our Box.. I tried an ABAP test Program ( SE38 ) and it works only for Logon Language = EN and doesn't work if I log in with DE or FR.


REPORT  ZTEST_SHAY_1                            .
  class CL_BSP_RUNTIME definition load.
  data TEXT type STRING.
  TEXT = CL_BSP_RUNTIME=>GET_OTR_TEXT(
      ALIAS = 'ZBTS/ZCONGRESS_ZMGR_EVAL_ACT_ITEM' ).
  write / TEXT.

Any help in this regard is highly appreciated..

Many thanks in Advance..

'Shay

PS: Our box is SAP_BASIS 620 SAPKB62043 ( SP 43)

Accepted Solutions (1)

Accepted Solutions (1)

former_member181879
Active Contributor
0 Kudos

You can test with a different language by adding it onto the url. Use sap-language. For example .../myapp/page.htm?sap-language=fr. However, you must NOT start it with a mangled URL, as the language is then already in there and your new requested language is not added.

Keep in mind that you must translate all these texts. OTR just marks the text for you and push them into translation program. Then you have to start the correct transation (I have forgotten) and exercise your French.

thomasalexander_ritter
Active Contributor
0 Kudos

<i>2) Do I have to make my Labels ( for example ) as texts in OTR to use it? We are talking about 100s of texts on BSP application.. such as Labels, Push buttons etc..I am hoping this code will work..</i>

Yes, you will have to translate them all but the nice thing about otr is that you can reuse a lot textpieces

<i>1) How do I test my BSP application in .. say .. French</i>

Modify the url like Brain told you or switch the language in your internet explorer (that's what I do when I test our english translations). Go internet options->general tab->Button languages. There you can add and set the language you need.

<i>3) Is there any kind of installation that needs to be done to be able to run OTR on our Box.. </i>

No it should work right away

Further hints:

-You have to use the transaction se63_otr for translating your otrs in the different languages.

-When you are using MVC don't forget that SAP has this nice features called textpools and every class has its own textpool. It's great stuff especially for error messages (use the textpool in your controller classes).

-Take a look at craigs weblog:

/people/sap.user72/blog/2004/09/15/bsp-howto-exploring-bsp-development-and-the-miniwas-620-part-4b

Have a nice day

Thomas

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks All.

Craig, Brian and Thomas..

You gentlemen have a fine day as well ( or is it night? )..

'Shay

Former Member
0 Kudos

The lights came on now didn't they? LIke I said I know how you feel, I was there I hada feeling you might not be aware of the "manual" side of it

Great to see you on your way now!

Former Member
0 Kudos

yeah!.. and feel Great.. can't wait to share it at work..

It is a pain that we have to Translate and Maintain in the required langauges..

I wish ( like the google webservice ) Altavista/babelfish put out some webservice that will do the translation for you.. Then you can dynamically maintain the Translation for Small texts ( less than 5 words )..

Former Member
0 Kudos

Well if you think about it do you really want someone else's service doing the work for you? I mean what happens if they are down or make a mistake then your app is wrong. Although the webservice is easy to accomplish

former_member181879
Active Contributor
0 Kudos

I can do all the translations for you at the right price Currencies we accept are cookies, chocolates, good books, ...

Former Member
0 Kudos

Careful we might take you up on it the price seems right

former_member181879
Active Contributor
0 Kudos

But that is the point: move the price up until no one takes me up on the offer, or it is really well worth the effort

Former Member
0 Kudos

You are right Craig.. There are a lot of dis-advantages.

I am not even sure if the translation I did ( using some tools avaliable on the Web ) is accurate.. I remember last time I did that My Canadian French Client was upset that I was getting it all "not so right!".. But she was very patient..I guess the French speaking Canadians are very passionate about their language..

I am still trying to figure out why this is not working..


          <xhtmlb:buttonGroupItem key        = "addGroup"
                                  text       = "<%= OTR(ZTRACK/ADD_NEW) %>"
                                  tooltip    = "<OTR>Add New Group</OTR>"
                                  showAlways = "TRUE" />

Ocassionally the tooltip comes back with translation..

I am still playing with it and I am hopeful I will think of something/...

Ciao ..

'Shay

thomasalexander_ritter
Active Contributor
0 Kudos

Hmm I don't use the <otr></otr> tags. I have seen that Thomas Jung use them but I never got them really working. So I just use the OTR(myTranslation/Hello) because there were never any problems with them. Why do you mix them?

Thomas

Former Member
0 Kudos

Thomas is right why mix the two? The one works just every time. Thomas Jung perhaps has the advantage he is in 640 I'm not sure though.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I never had any problems with either type of OTR usage in 620 or 640 (and my users are usually fairly vocal when a translation is missing).

I mix the two for two main reason. When using the OTR(ZTRACK/ADD_NEW) variant you are creating a global translation in effect. The transalation will be easily reusable. But quite often what you are translating is very specific to the page in question. You don't want to clutter up your global translation area with this one-time junk. There I use the <OTR></OTR>. Then this translation is tied directly to the page/view where it is inserted. This does mean that you have to translate the elements a page at a time however.

The other reason is readability (although this is really secondary). It is similar to using text objects in regular ABAP. You can use text-001 or 'This is my Text'(001).

thomasalexander_ritter
Active Contributor
0 Kudos

Yeah that makes sense Thomas. Btw I think there a lot interesting details in this tread perhaps Craig should update his weblog?

Former Member
0 Kudos

I barely touched on the topic at all really. I suppose I could pop some more info into it.

Former Member
0 Kudos

Thomas, your practice looks nice. actually I use OTR(Package/alias) ... Users were a little bit disturbed by SE63 and difference between short and long otr...

Transport of OTR it's strange ... Some translations will be unvisible... I have to do a $sync or $otr ...

Ok this message is to say : your practice will impact mine.

Thanks a lot

Former Member
0 Kudos

Hi there, I know how you feel.

How have you maintained the OTR values for your different languages?

To test the best way of course is to login in that language then you are sure 100%.

Try something like this code in your testing.


<phtmlb:formLayoutInputField id = "fName"
pos = "col=1"
label = "<%= otr('ZTRACK/FirstName') %>"
value = "//mdl_track/LT_USR_SRCH.ZFIRST_NAME" />

Former Member
0 Kudos

Thanks Craig for your post.

See.. I didn't know that we HAVE to maintain ( manually ) the texts in all different Languages ( desired Lang. ).

I didn't have authorization to create a Transport request and hence couldn't really use SE63 to create Translation.

Now.. I have Maintained texts for my OTR in two different Languages.. ( although the translation is not accurate - I am still testing )..

I am not sure HOW TO TEST if that is working..

How do I log into a BSP with a different Log-on Language..

I tried logging into my 620 box with DE as Logon

I also tried concatenating my BSP URL with

?~sap-language=DE still no luck.

When I say Display OTR concept I can see two Languages that are maintained for that OTR text.

To test for Q1 and Q2 .. I need to log into the BSP with DE as my Language.. How do I do this( how to test my BSP)?

Thanks agin for your response ...

Your question solved my Q3.It is working..

>

> How have you maintained the OTR values for your

> different languages?

>