; Module/File: System_GtkGetDefLanguage.pb ; Function: Get RFC-3066 format string representing the default language in gtk - Linux ; Author: Omi ; Date: Sep. 09, 2015 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ;also see GetEnvironmentVariable("LANG") and others ... EnableExplicit ImportC "" pango_language_get_default() pango_language_get_sample_string(*language) pango_language_to_string(*language) EndImport #Win_Main= 0 #Lbl1 = 0 #Lbl2 = 1 Global.i gEvent, gEventWin, gQuit Global *gPangoLanguage Procedure CreateWin_Main() If OpenWindow(#Win_Main, 300, 200, 600, 100, "Current language", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) ;the language format string ... TextGadget(#Lbl1, 5, 5, 590, 28, "Current language setting : " + PeekS(pango_language_to_string(*gPangoLanguage), -1, #PB_UTF8)) ;a string with all chars in curr. language ... TextGadget(#Lbl2, 5, 35, 590, 28, "Representative sample string: " + #LF$ + PeekS(pango_language_get_sample_string(*gPangoLanguage), -1, #PB_UTF8)) EndIf EndProcedure *gPangoLanguage= gtk_get_default_language_(); or ... ;*gPangoLanguage= pango_language_get_default(); same function CreateWin_Main() Repeat gEvent= WaitWindowEvent() gEventWin= EventWindow() If gEventWin = #Win_Main Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect EndIf Until gQuit ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 31 ; FirstLine = 7 ; Folding = - ; EnableUnicode ; EnableXP