×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    50

    PhoneLanguageData

    Hello everyone,

    I found this Method in the Library, see here

    but I don't know how I can implement it.
    Hope someone has the code or an answer.

    I need it to get the country code of the device.

    thanx
    florianhaar
    Last edited by florianhaar; 2010-10-26 at 11:56.

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: PhoneLanguageData

    The object you referred to is a part of Platform services 2.0 system information API.

    The code below should do the trick after you have copied platformservices.js file to your project and included it in your main html-file.

    Platform Services 2.0
    Code:
    var sysinfo_so;
    
    function getLang(){
    
    	try {
    		
    		sysinfo_so = nokia.device.load("sysinfo");		
    		var phoneLanguageData = sysinfo_so.getChannel("PhoneLanguage");
    		alert(phoneLanguageData.phoneLanguage);
    		    
    	}catch(e) {
    		alert(e);
    	}
    }
    If you don't want to use Platform services 2.0 for some reason you can do this with PS 1.0 as well
    Code:
    function getLangPs10(){
    	try {
    		var so = device.getServiceObject("Service.SysInfo", "ISysInfo");
    		
    		var criteria = {
    			Entity: "General",
    			Key: "DisplayLanguage"
    		};
    		
    		var result = so.ISysInfo.GetInfo(criteria);
    		
    		if(result.ErrorCode == 0 ){
    			alert(result.ReturnValue.StringData);
    		}
    
    	}catch(e){
    		alert(e);
    	}
    }
    -Ilkka
    Last edited by isalento; 2010-10-26 at 14:42. Reason: Added PS 1.0 way

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    50

    Re: PhoneLanguageData

    Hi isalento,

    thank you very much.
    That is what I had searched for.

    thanx
    florianhaar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×