How can i get the system language of machine in script

Hi,
During postinstall, i want to install file based on the system language.
How can i get the system language of machine in script ?
Thanks,

Michael Conniff wrote:
I don't get it: what you posted gives a list of all the languages (and I don't see what awk brings to the party).
Hmm. On my laptop the first bit gets me the list of languages as they appear in the listing in the International preferences pane:
(en, de, es, ja, fr, it, nl, sv, nb, da, fi, pt, "zh-Hans", "zh-Hant", ko)
So I piped that to awk to pull out just the first one (they're ordered just like they are in the prefs pane, with the current language first). But that gives me some extra text:
(en,
So I piped that to sed to remove the comma and parenthesis. That gives me the current code, which in my case was "en" (or "de" if I switched the language).
defaults read -g AppleLocale
gives me en_GB. So maybe this last is better for you?
Well, sure, if you want to do it the easy way. But where's the fun in that? Seriously though, I get en_US, which is a more accurate and complete view of my settings...
charlie

Similar Messages

  • How can I get the system date in mm/dd/yyyy,

    how can I get the system date in mm/dd/yyyy, i need to compare system date with some other date,continuosly using threads,can U plz help me.
    With Some code
    Thanks In advnace
    Mahiiii

    Hi,
    You can use SimpleDateFormat class under java.text package.
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy h:mm a z", new Locale());
    //formatter.setTimeZone(timezone);
    String dateTime = formatter.format(new Date());

  • How can i get the System Time from the other host

    I want to get the System Time from the other host in the LAN,How can I get the Time using Java.
    Such as I am in WIN 2000 and I have a Unix host in LAN, I want to get unix host System time, How can I do it.

    Open a socket to port 13 and read a string with the time.
    -or-
    Open a socket to port 27 and read 4 bytes that are a network order timestamp
    Assuming that your UNIX machine has those services running, most do

  • How  can i get the system ip address through d2k/oracle

    hi
    how can i get the I.P. address of the System, whether any builtin function is available oracle/d2k.
    please do needful help

    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:510222107880

  • How can I getting the system drives list?

    Hello again. I'd like to create a dropdown list with the computer's drives, so you can easily change from one to another without using a "selectDialog" File object. Is it possible?
    Thanks beforehand :)

    Its something I havn't tried.
    On a PC you might be able to use VB/VBS to get the file list, put them in an env so that you can read them from Javascript.
    Here is a bit of code found on the net.
    Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
    Set Drives = FileSystemObject.Drives
    For Each DiskDrive in Drives
    DriveLetter = DiskDrive.DriveLetter
    DriveType = DiskDrive.DriveType
    Select Case DriveType
    Case "0" DriveType = "Unknown type of drive"
    Case "1" DriveType = "Removable drive"
    Case "2" DriveType = "Fixed drive"
    Case "3" DriveType = "Network drive"
    Case "4" DriveType = "CD-ROM drive"
    Case "5" DriveType = "RAM Disk"
    End Select
    WScript.Echo "Drive " & DriveLetter & " is a " & DriveType
    Next
    Set Drives = nothing
    Set FileSystemObject = nothing

  • How can I get the length of a sequence using script

    I am trying to get the length of an image sequence that was imported using importOptions.sequence.  I need to check that the length is a correct number, and if it is too short/long it gives an error message.
    Is there a way to do this?
    Thanks

    //Assumes that your clip is the first item in your project
    var a = app.project.item(1).duration;     //Returns clip length in seconds
    var b = app.project.item(1).frameDuration     //Returns a single frame length in seconds
    var c = a/b;     //If you divide the clip duration by the frameDuration, you should get clip length in frames

  • HT5219 How can i get the Apple Thunderolt display to show Windows 7 i run on my system using Paralells desktop..

    How can i get the Apple Thunderolt display to show Windows 7 i run on my system using Paralells desktop..

    You may need to set the slider at the upper-right corner of the Control window to something other than the extreme left-most position:
    Hope this helps.

  • How can i get the details on system before 2 months

    Hi gurus,
              To find the Total cpu time ,  cummulative users  we go for St03 and extract it. The details are available for only last 2 months.  How can i get the prevous months details. Is there any special job or parameter meant on SAP behalf, so tat it clears the history. If it runs kindly tel me wat job or parameter it is. And also tel how can i get the previous months details.
    Thank you.
       Livi.
    Moderator message: not directly related to ABAP development, please have a look in the Netweaver forums.
    Edited by: Thomas Zloch on Jan 5, 2011 11:43 AM

    Hi
    U should ask that to your basis, I know the system has the statistic data for a certain period only, the older data are deleted: I don't know if before deleting it a backup is done....but I don't believe
    Max

  • I downloaded new Firefox but now can't open Firefox at all. It says it is not supported on my system. How can I get the earlier version which I deleted?

    I downloaded new Firefox but now can't open Firefox at all. It says it is not supported on my system. How can I get the earlier version which I deleted?

    http://www.mozilla.com/en-US/firefox/4.0/system-requirements/ <br />
    Mac
    Operating Systems
    * Mac OS X 10.5
    * Mac OS X 10.6
    Recommended Hardware
    * Macintosh computer with an Intel x86 processor
    * 512 MB of RAM
    * 200 MB hard drive space
    For older Macs that aren't supported in Firefox 4.0, try TenFourFox for PowerPC's running Mac 10.4.11 & 10.5.8 . <br />
    http://www.floodgap.com/software/tenfourfox/

  • How can I get the language of the user logged on using only DI API?

    Hello,
    how can I get the language of the user logged on using only DI API,
    without invoking the UI?
    Can I read the value from some table using sql?
    I could write to file the first user's connection to the language code in SAP and then use it from external program, but I do not like this solution ...
    I know only this possibility:
            '_SboCy ==> SAPbobsCOM.Company
            '_SboCys ==> SAPbobsCOM.CompanyService
            '_SboApp ==> SAPbouiCOM.Application
            CodLng Dim As String = ""
            Dim lng As SAPbobsCOM.UserLanguages _SboCy.GetBusinessObject = (BoObjectTypes.oUserLanguages)
            If lng.GetByKey (_SboApp.Language) Then
                codLng = lng.LanguageShortName
                'Etc. ..
            End If
            lng = Nothing
    Thanks

    Hi Enrico,
    The language settings are held on the user's Windows profile and not in the database. In SBO 2007A onwards there is an XML file that is created by the SBO client (previous versions stored the information in the registry). The file is called b1-current-user.xml and you'll find it in the temporary application data under the user's profile (by default this will be C:\Documents and Settings\<profile>\Local Settings\Application Data\SAP\SAP Business One for Windows XP). This XML file contains a node that looks like the following:
    <leaf kind="single" name="Language" type="String">
         <value>8</value>
    </leaf>
    where the value is the language id that should correspond to the same setting in the DI API. If your application will always run on a workstation where the SBO client is installed then you could read this XML file. Of course, this file may not exist for a particular Windows user if they have never opened the SBO client so you'd need to have a default setting.
    If you application will be installed on a workstation which doesn't have an SBO client installed on it then there is no way to tell what default language to use and you'll need to build this logic in to your own application (eg have a screen where the user can choose their preferred langauge and then store this as a config file in a similar way to how the SBO client works).
    Kind Regards,
    Owen

  • How can I get the information of current BW system id?

    How can I get the information of current BW system id '0TCTSYSID' or 'LOGSYS'?
    thank your attention!

    Transaction SCC4 will give you the current logical system you are connected to (double click on the current client).
    Regards,
    Fred

  • I want to email photos on a different email system, gmail. How can I get the email icon of iphoto to put my photo on a gmail email?

    I want to email photos on a different email system, gmail. How can I get the email icon of iphoto to put my photo on a gmail email?

    If you have Mail setup a a client for your Gmail account set iPhoto to use Mail.  Then select one of Mail's stationary templates for photos and use it. May not be as good as the iPhoto templates but will be fancier than a plain email window.
    Click to view full size
    OT

  • How can we get the values from the view?

    Hi All,
    my scenario is i have two fields in my view .one is parameter.and another on is select-options.how can i get the user entered values into my selection screen.?
    for the select options i get the values into field-symbol.for parameter i get the value using get_attribute.
    can i use like this in select statement.
    WHERE SERVICE_ID  = ZSD_DD_AUFNRS
                       AND CRE_DT IN <FS_DATE>.
    Regards,
    Ravi.

    Hi Sravan,
    when i am using the below code to generate self defined functions i m getting a error .
    *Generate an object for self defined functions
      DATA: lo_self_functions TYPE REF TO if_salv_wd_function_settings,
    *Generate an object for button 'Confirm'
           lr_button TYPE REF TO cl_salv_wd_fe_button,
           lo_self_function TYPE REF TO cl_salv_wd_function,
                  l_text type string.
    *Set Self-defined functions
    *'Confirm' Button
      lo_self_functions ?= l_value..
      lo_self_function = lo_self_functions->create_function( 'CONFIRM'  ).
      CREATE OBJECT lr_button.
      CLEAR l_text.
      l_text = 'Confirm'.
      lr_button->set_text( l_text ).
      lr_button->set_image_source( '' ).
      lr_button->set_image_first( 'X' ).
      lo_self_function->set_editor( lr_button ).
    Error when processing your request
    What has happened?
    The URL http://cgslsvr3.cgsl.com:8020/sap/bc/webdynpro/sap/zsdr_cash_work_list/ was not called due to an error.
    Note
    The following error text was processed in the system CGD : WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set
    The error occurred on the application server cgslsvr3_CGD_20 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: RAISE of program CX_WD_GENERAL=================CP
    Method: CONSTRUCTOR of program CL_WDR_VIEW_ELEMENT===========CP
    Method: CONSTRUCTOR of program CL_WD_TOOLBAR_BUTTON==========CP
    Method: NEW_TOOLBAR_BUTTON of program CL_WD_TOOLBAR_BUTTON==========CP
    Method: IF_SALV_WD_COMP_TABLE_UI~CREATE_TOOLBAR_ITEM of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~CREATE_TOOLBAR_ITEMS of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE_TOOLBAR_ITEMS of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE_TOOLBAR of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    What can I do?
    If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system CGD in transaction ST22.
    If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server cgslsvr3_CGD_20 in transaction SM21.
    If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server cgslsvr3_CGD_20 . In some situations, you may also need to analyze the trace files of other work processes.
    If you do not yet have a user ID, contact your system administrator.
    Error code: ICF-IE-http -c: 110 -u: CT-0024 -l: E -s: CGD -i: cgslsvr3_CGD_20 -w: 0 -d: 20080414 -t: 105835 -v: RABAX_STATE -e: UNCAUGHT_EXCEPTION
    HTTP 500 - Internal Server Error
    Your SAP Internet Communication Framework Team
    How can i resolve it?
    Regards,
    Ravi

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

Maybe you are looking for

  • Rca video out

    I have an imac g5 rev, B and a apple video adapter that turns reular video out to a single cable that can be anything really. I was wondering if i can use to hook up a video rca yellow cable to my tv and view my imac on my tv. Is that possible cause

  • MDM 7.1 not able to open in MDS console

    Hello, From MDM console, i'm trying to have DBMS Setting of Oracle 10.2.0.4, but it is giving me error as Database not connected, when i checked in logs file, it is giving me "Oracle Initialization Failed -- likely missing libraries/dlls". "ERROR COD

  • No InDesign previews

    Mac OSX 10.4.11 Bridge CS4 InDesign previews are not showing. I'm only icon previews. Any ideas? Thanks.

  • Encoding problem with Application adapter for OEBS

    Hello All! We going to pass value via app adapter from EBS Forms to Content Server page. Link to documentation Configuring the Managed Attachments Solution - 11g Release 1 (11.1.1) We have done all setting, and this function is working now . It is go

  • "Movie to ipod (320x240)" qtime codec distorts aspect ratio!

    a minor complaint, but a valid one... the only quicktime codec that seems to be compatible for the new video ipod (movie to ipod 320x240) squeezes the video files so that they are ever so slightly taller than it should be. also, they take an ice age