cancel
Showing results for 
Search instead for 
Did you mean: 

Changing language of view

Former Member
0 Kudos

Hi

I am going to change a ESS based webdynpro "LeaveRequest" supplied by SAP.But when I synced to my NWDS the texts inside the view's are german language.How to change it to english ?

We know that we can change the language of local webdynpro project by changing the <Properties> tag of .tssalinfo file of the project.

Thanks

Ananda

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hey

Any Experts please reply

Ananda

roberto_tagliento
Active Contributor
0 Kudos

I never used SAP standard for language for this reason, and because it need logoff e logon the user, for get effective the portal language.

I do this with a my custom method, that launch when is necessary on wdModify.

And use IScope (session variable) for get user language choice.

I have the language file where i wish, into project MIMEs, into KM folder (in this case, my customer can change when want the translation) and same into DB, binary field.

It is a bit elaborated, but works good for me.

The idea is give specific ID to each UIelement, the unlucky is i haven't had the time to find a way to set the TEXT propoerty of a generic UIelement.

So i do this with specific casting of object, and use particular ID for each type of UIelement.

Look the code and maybe understand better


  public void SetLabelsText( com.sap.tc.webdynpro.progmodel.api.IWDView IWDView, java.util.Vector ViewIDs )
  {
    //@@begin SetLabelsText()
	int i, n;
		String id_tx = new String("");
		String value_tx = new String("");
     
		//V1C01

			i = 0;
//			n = ViewIDs.size();//wdThis.Get_Num_Label();
			n = Language_Props.size();
			
			
			
			Enumeration enum = Language_Props.propertyNames();
			for (; enum.hasMoreElements(); ) {
			 try {
				id_tx    = (String)enum.nextElement();

				value_tx = Language_Props.getProperty(id_tx);
								
				switch (id_tx.charAt(0)){
					case 'b':
						IWDButton BtnEl = (IWDButton) IWDView.getElement(id_tx);
						BtnEl.setText(value_tx);
						break;
//					case 'E':
//						IWDTextView TextEl = (IWDTextView) IWDView.getElement(id_tx);
//						TextEl.setText(value_tx);
//						break;
					case 'c':
						IWDCaption CaptEl = (IWDCaption) IWDView.getElement(id_tx);
						CaptEl.setText(value_tx);
						break;
					case 'k':
						IWDCheckBox CheckEl = (IWDCheckBox) IWDView.getElement(id_tx);
						CheckEl.setText(value_tx);
						break;
					case 'l':
						IWDLabel LabEl = (IWDLabel) IWDView.getElement(id_tx);
						if (value_tx.indexOf(";")>0) {
							LabEl.setText(value_tx.substring(0,value_tx.indexOf(";")));
							LabEl.setTooltip(value_tx.substring(value_tx.indexOf(";")+1,value_tx.length()));
						} else {
							LabEl.setText(value_tx);
							//LabEl.setTooltip(value_tx);
						}
						break;
						
				}
			
				} catch (RuntimeException e) {
					//e.printStackTrace();
				}
			
			
				i++;
			}
    //@@end
  }

roberto_tagliento
Active Contributor
0 Kudos

I know you are working with ESS and my solution cannot help probably, but maybe can give you some idea.

Good work.

former_member186016
Active Contributor
0 Kudos

Hi,

The text for the UI elements are in .xlf and .proprties files for each view.

The standard procedure is :

Texts in various languages needs to be generated via manual tranlation and then they are uploaded onto the DTR server.

When you sync the project from DTR, according to language of project texts will be downloaded.

I am not sure of scenario which you are telling here. May be change the language in .tssalinfo file to "en" and then resync the sources of project.

Regards,

Ashwani

Former Member
0 Kudos
Former Member
0 Kudos

tx, anil

But when I open a view to change something., text elements eg. caption is showing german text instead of english at design time.

I just want to display the texts as english in design time.

How to do that ?

Ananda

former_member186016
Active Contributor
0 Kudos

Hi,

The .xlf and properties should have texts in english, then only in DT you will see the texts in english. You have to get these text in english somehow. I know one way is via manual transalation. I don't think there is any other way.

Regards,

Ashwani