اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

الردود الموصى بها

قام بنشر

إن كنت تريد أن تسخدمه في تحديد اللغة التي ستكتب بها في حقول معينة في النموذج .. فهناك خاصية موجودة من ضمن خصائص الحقل .. وهي خاصية لغة الكيبورد أو اتجاه الكتابة حسب ما أذكر .. ويمكنك منها أن تختار الاتجاه من اليمين للييار أو العكس وستتغير اللغة بمجرد التركيز على مربع النص حسب اللغة المختارة ..

قام بنشر (معدل)
12 ساعات مضت, Moosak said:

لا اقصد ذلك 
محتاج لغه الويندوز نفسها الموجوده فى ال

Captureييييي.JPG

تم تعديل بواسطه UserUser2
قام بنشر

السلام عليكم ,, لمعرفة ذلك يجب عليك استخراج كود اللغة او ما يسمى بLCID عن طريق الكود التالى :

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

الخطوة التالية هو معرفة اللغة صاحبة الكود وذلك عن طريق احضارها من النت ولكن ماذا اذا كان الجهاز غير متصل بالنت ؟ فقمت باختصار الامر وعمل جدول باكواد اللغات ويتم احضارها من الجدول وعرضها فى رسالة  , النتيجة :

1.PNG.454f3e87528e1bd688bd540cdc924467.PNG

مرفق قاعدة البيانات  . بالتوفيق

 

Language.accdb

  • Like 3
قام بنشر
4 ساعات مضت, Amr Ashraf said:

السلام عليكم ,, لمعرفة ذلك يجب عليك استخراج كود اللغة او ما يسمى بLCID عن طريق الكود التالى :

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

الخطوة التالية هو معرفة اللغة صاحبة الكود وذلك عن طريق احضارها من النت ولكن ماذا اذا كان الجهاز غير متصل بالنت ؟ فقمت باختصار الامر وعمل جدول باكواد اللغات ويتم احضارها من الجدول وعرضها فى رسالة  , النتيجة :

1.PNG.454f3e87528e1bd688bd540cdc924467.PNG

مرفق قاعدة البيانات  . بالتوفيق

 

Language.accdb 1.06 \u0645\u064a\u062c\u0627 \u0628\u0627\u064a\u062a · 5 downloads

وعليكم السلام 
جزاك الله خيراً اخى الكريم 
من فضلك محتاج اضع الكود عند فتح النموذج 
بحيث لو كود اللغه يساوى 4105 يفتح عادى ولو غير ذلك يظهر رسالة مطلوب تغير اللغه 

قام بنشر
10 دقائق مضت, UserUser2 said:

بحيث لو كود اللغه يساوى 4105 يفتح عادى ولو غير ذلك يظهر رسالة مطلوب تغير اللغه 

ارفق النموذج للتعديل عليه

قام بنشر (معدل)

تفضل التعديل . الاكواد ممكن جعلها افضل من ذلك ولكن انا بعملها وانا فاتح عين واحدة هنام 😆 ولذلك فلنكتفى بها هكذا للوقت الحالى واذا اردت تحسينها يمكننا ذلك فى اى وقت .

Language 2.accdb

تم تعديل بواسطه Amr Ashraf
  • Thanks 1
قام بنشر
في 11‏/8‏/2022 at 17:21, Amr Ashraf said:

تفضل التعديل . الاكواد ممكن جعلها افضل من ذلك ولكن انا بعملها وانا فاتح عين واحدة هنام 😆 ولذلك فلنكتفى بها هكذا للوقت الحالى واذا اردت تحسينها يمكننا ذلك فى اى وقت .

Language 2.accdb 1.06 \u0645\u064a\u062c\u0627 \u0628\u0627\u064a\u062a · 3 downloads

اللغه مظبوطه على انجليزى كندا 
ومع ذلك بيظهر الرسالة 

سسسش.JPG

شششش.JPG

قام بنشر

وجدت أيضا هذا الكود وظيفته أن يحظر لك اللغة المحلية للجهاز ولكنه لا يذكر الدولة ..

' Written: March 01, 2012
' Author:  Leith Ross
' Summary: Converts a Language Code Identifier (LCID) into the language name.

Private Declare PtrSafe Function GetLocaleInfoA _
    Lib "kernel32.dll" _
        (ByVal Locale As Long, _
         ByVal LCType As Long, _
         ByVal lpLCData As String, _
         ByVal cch As Long) _
    As Long

Function GetLanguageName(ByVal LCID As Long) As String

    Const LOCALE_SENGLANGUAGE As Long = &H1001
    Const LOCALE_SENGCOUNTRY As Long = &H1002

    Dim Buffer As String
    Dim BuffSize As Long
    Dim RetVal As Long

        BuffSize = GetLocaleInfoA(LCID, LOCALE_SENGLANGUAGE, 0, 0)
        Buffer = String(BuffSize, Chr(0))

        RetVal = GetLocaleInfoA(LCID, LOCALE_SENGLANGUAGE, Buffer, BuffSize)

        If RetVal > 0 Then GetLanguageName = Left(Buffer, BuffSize - 1)

End Function

Function GetLanguage() As String
GetLanguage = GetLanguageName(Application.LanguageSettings.LanguageID(msoLanguageIDUI))
MsgBox GetLanguage
End Function

قم باستدعاء الدالة التالية لمعرفة اللغة :

Call GetLanguage()

 

قام بنشر
19 ساعات مضت, UserUser2 said:

اللغه مظبوطه على انجليزى كندا 

شغال عندى كويس المرفق .. ممكن احد الاخوة يجربه ويفيدنا بالنتيجة ؟

قام بنشر

زيادة في الاثراء ... انظر هنا

في 15‏/10‏/2015 at 05:26, ابو عارف said:

يا سلام يا ابا جود! هذا ما يسمونها بلاغة ، بالضبط هذا ما كنت ابحث عنه لازائد ولا ناقص. جزاك الله الخير

الاخ / Yms12

انشيء وحدة النمطية بالكود التالي

Public Const LOCALE_ILANGUAGE             As Long = &H1    'language id
Public Const LOCALE_SLANGUAGE             As Long = &H2    'localized name of lang
Public Const LOCALE_SENGLANGUAGE          As Long = &H1001 'English name of lang
Public Const LOCALE_SABBREVLANGNAME       As Long = &H3    'abbreviated lang name
Public Const LOCALE_SNATIVELANGNAME       As Long = &H4    'native name of lang
Public Const LOCALE_ICOUNTRY              As Long = &H5    'country code
Public Const LOCALE_SCOUNTRY              As Long = &H6    'localized name of country
Public Const LOCALE_SENGCOUNTRY           As Long = &H1002 'English name of country
Public Const LOCALE_SABBREVCTRYNAME       As Long = &H7    'abbreviated country name
Public Const LOCALE_SNATIVECTRYNAME       As Long = &H8    'native name of country
Public Const LOCALE_SINTLSYMBOL           As Long = &H15   'intl monetary symbol
Public Const LOCALE_IDEFAULTLANGUAGE      As Long = &H9    'def language id
Public Const LOCALE_IDEFAULTCOUNTRY       As Long = &HA    'def country code
Public Const LOCALE_IDEFAULTCODEPAGE      As Long = &HB    'def oem code page
Public Const LOCALE_IDEFAULTANSICODEPAGE  As Long = &H1004 'def ansi code page
Public Const LOCALE_IDEFAULTMACCODEPAGE   As Long = &H1011 'def mac code page

Public Const LOCALE_IMEASURE              As Long = &HD     '0 = metric, 1 = US

'#if(WINVER >=  &H0400)
Public Const LOCALE_SISO639LANGNAME       As Long = &H59   'ISO abbreviated language name
Public Const LOCALE_SISO3166CTRYNAME      As Long = &H5A   'ISO abbreviated country name
'#endif /* WINVER >= as long = &H0400 */

'#if(WINVER >=  &H0500)
Public Const LOCALE_SNATIVECURRNAME        As Long = &H1008 'native name of currency
Public Const LOCALE_IDEFAULTEBCDICCODEPAGE As Long = &H1012 'default ebcdic code page
Public Const LOCALE_SSORTNAME              As Long = &H1013 'sort name
'#endif /* WINVER >=  &H0500 */

Public Declare Function GetThreadLocale Lib "kernel32" () As Long

Public Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long

Public Declare Function GetLocaleInfo Lib "kernel32" _
   Alias "GetLocaleInfoA" _
  (ByVal locale As Long, _
   ByVal LCType As Long, _
   ByVal lpLCData As String, _
   ByVal cchData As Long) As Long


Public Function GetUserLocaleInfo(ByVal dwLocaleID As Long, ByVal dwLCType As Long) As String

   Dim sReturn As String
   Dim r As Long
   r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn))
   If r Then
   sReturn = Space$(r)
   r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn))
   If r Then
   GetUserLocaleInfo = Left$(sReturn, r - 1)
   End If
   End If
End Function

ثم في النموذج انشيء 21 مربعات نص و سميها من Text1 الى Text21

انشيء زرالامر و الصق هذالكود في حدث عند النقر

 Dim LCID As Long
   
   LCID = GetSystemDefaultLCID()
   Text1 = GetUserLocaleInfo(LCID, LOCALE_ICOUNTRY)
   Text2 = GetUserLocaleInfo(LCID, LOCALE_IDEFAULTANSICODEPAGE)
   Text3 = GetUserLocaleInfo(LCID, LOCALE_IDEFAULTCODEPAGE)
   Text4 = GetUserLocaleInfo(LCID, LOCALE_IDEFAULTCOUNTRY)
   Text5 = GetUserLocaleInfo(LCID, LOCALE_IDEFAULTEBCDICCODEPAGE)
   If Len(Text5) = 0 Then Text5 = "Sorry, Windows 2000 only"
   Text6 = GetUserLocaleInfo(LCID, LOCALE_IDEFAULTLANGUAGE)
   Text7 = GetUserLocaleInfo(LCID, LOCALE_IDEFAULTLANGUAGE)
   Text8 = GetUserLocaleInfo(LCID, LOCALE_ILANGUAGE)
 Select Case GetUserLocaleInfo(LCID, LOCALE_IMEASURE)
      Case "0": Text9 = "0 - Metric system is used"
      Case "1": Text9 = "1 - U.S. system is used"
   End Select
   Text10 = GetUserLocaleInfo(LCID, LOCALE_SCOUNTRY)
   Text11 = GetUserLocaleInfo(LCID, LOCALE_SENGCOUNTRY)
   Text12 = GetUserLocaleInfo(LCID, LOCALE_SENGLANGUAGE)
   Text13 = GetUserLocaleInfo(LCID, LOCALE_SINTLSYMBOL)
   Text14 = GetUserLocaleInfo(LCID, LOCALE_SISO3166CTRYNAME)
   Text15 = GetUserLocaleInfo(LCID, LOCALE_SISO639LANGNAME)
   Text16 = GetUserLocaleInfo(LCID, LOCALE_SABBREVLANGNAME)
   Text17 = GetUserLocaleInfo(LCID, LOCALE_SLANGUAGE)
   Text18 = GetUserLocaleInfo(LCID, LOCALE_SNATIVELANGNAME)
   Text19 = GetUserLocaleInfo(LCID, LOCALE_SNATIVECTRYNAME)
   Text20 = GetUserLocaleInfo(LCID, LOCALE_SNATIVECURRNAME)
   If Len(Text20) = 0 Then Text20 = "Sorry, Windows 2000 only"
   Text21 = GetUserLocaleInfo(LCID, LOCALE_SSORTNAME)
   If Len(Text21) = 0 Then Text21 = "Sorry, Windows 2000 only"

 

ملحوظة:-

يبدو الكود مخصص للويندوز 2000 ولكن حسب تجربته يعمل في ويندوز سفن ايضا و باقي انواع ويندوز.. الله اعلم

بالتوفيق

 

 

 

قام بنشر (معدل)

انا جربت على اللغة اللى عندى بالكود التالى 1033 :

Private Sub Form_Open(Cancel As Integer)
    Dim lngCode As Long
    lngCode = Application.LanguageSettings.LanguageID(msoLanguageIDUI)
    If lngCode = 1033 Then
        DoCmd.OpenForm "form2"
        Else
        MsgBox "íÑÌì ÊÛíÑ ÇááÛå Çáì :" & vbNewLine & GetTxt(4105) & vbNewLine & " ÇááÛÉ ÇáÍÇáíÉ åì :" & vbNewLine & GetTxt(lngCode), vbDefaultButton1, "ÊäÈíÉ"
    End If
End Sub

 

وكانت النتيجة كالتالى :

2.PNG.9b495a93e8f0d4a322ad9a9e53e279e3.PNG

 

تم فتح النموذج رقم 2 كما طلبت انت .

 

 

 

 

 

تم تعديل بواسطه Amr Ashraf
قام بنشر (معدل)

بعد اعادة التجربة الكود دائما بيقرأ الدولة United States وخدعنى لأن بالفعل اللغة عندى English - United States 😄

تعديل : عرفت سبب المشكلة الكود بيجيب اللغة الخاصة بالأوفيس وليس الويندوز ولذلك عند تغيير لغة الويندوز لم تظهر التغييرات وظلت United States كما هى .

الحل الخاص بى باستخدام الاكسيس لم ينفع فى هذه الحالة ولذلك أحد الاخوة ان شاء الله سيقدم الحل  .

فى حالة عدم وجود الحل بالاكسيس يمكننى برمجة اداة صغيرة لانجاز المطلوب  .

بالتوفيق

تم تعديل بواسطه Amr Ashraf
قام بنشر

السلام عليكم 🙂

 

مع اعتذاري للشباب ، فلم القي نظرة على مرفقاتكم 🙂

 

احفظ هذه الدالة باسم mod_Regional_Settings_info :

Option Compare Database
Option Explicit

' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Public Const LOCALE_ILANGUAGE = &H1         '  language id
Public Const LOCALE_SLANGUAGE = &H2         '  localized name of language
Public Const LOCALE_SENGLANGUAGE = &H1001   '  English name of language
Public Const LOCALE_SABBREVLANGNAME = &H3   '  abbreviated language name
Public Const LOCALE_SNATIVELANGNAME = &H4   '  native name of language
Public Const LOCALE_ICOUNTRY = &H5          '  country code
Public Const LOCALE_SCOUNTRY = &H6          '  localized name of country
Public Const LOCALE_SENGCOUNTRY = &H1002    '  English name of country
Public Const LOCALE_SABBREVCTRYNAME = &H7   '  abbreviated country name
Public Const LOCALE_SNATIVECTRYNAME = &H8   '  native name of country
Public Const LOCALE_IDEFAULTLANGUAGE = &H9  '  default language id
Public Const LOCALE_IDEFAULTCOUNTRY = &HA   '  default country code
Public Const LOCALE_IDEFAULTCODEPAGE = &HB  '  default code page
Public Const LOCALE_SLIST = &HC             '  list item separator
Public Const LOCALE_IMEASURE = &HD          '  0 = metric, 1 = US
Public Const LOCALE_SDECIMAL = &HE          '  decimal separator
Public Const LOCALE_STHOUSAND = &HF         '  thousand separator
Public Const LOCALE_SGROUPING = &H10        '  digit grouping
Public Const LOCALE_IDIGITS = &H11          '  number of fractional digits
Public Const LOCALE_ILZERO = &H12           '  leading zeros for decimal
Public Const LOCALE_SNATIVEDIGITS = &H13    '  native ascii 0-9
Public Const LOCALE_SCURRENCY = &H14        '  local monetary symbol
Public Const LOCALE_SINTLSYMBOL = &H15      '  intl monetary symbol
Public Const LOCALE_SMONDECIMALSEP = &H16   '  monetary decimal separator
Public Const LOCALE_SMONTHOUSANDSEP = &H17  '  monetary thousand separator
Public Const LOCALE_SMONGROUPING = &H18     '  monetary grouping
Public Const LOCALE_ICURRDIGITS = &H19      '  # local monetary digits
Public Const LOCALE_IINTLCURRDIGITS = &H1A  '  # intl monetary digits
Public Const LOCALE_ICURRENCY = &H1B        '  positive currency mode
Public Const LOCALE_INEGCURR = &H1C         '  negative currency mode
Public Const LOCALE_SDATE = &H1D            '  date separator
Public Const LOCALE_STIME = &H1E            '  time separator
Public Const LOCALE_SSHORTDATE = &H1F       '  short date format string
Public Const LOCALE_SLONGDATE = &H20        '  long date format string
Public Const LOCALE_STIMEFORMAT = &H1003    '  time format string
Public Const LOCALE_IDATE = &H21            '  short date format ordering
Public Const LOCALE_ILDATE = &H22           '  long date format ordering
Public Const LOCALE_ITIME = &H23            '  time format specifier
Public Const LOCALE_ICENTURY = &H24         '  century format specifier
Public Const LOCALE_ITLZERO = &H25          '  leading zeros in time field
Public Const LOCALE_IDAYLZERO = &H26        '  leading zeros in day field
Public Const LOCALE_IMONLZERO = &H27        '  leading zeros in month field
Public Const LOCALE_S1159 = &H28            '  AM designator
Public Const LOCALE_S2359 = &H29            '  PM designator
Public Const LOCALE_SDAYNAME1 = &H2A        '  long name for Monday
Public Const LOCALE_SDAYNAME2 = &H2B        '  long name for Tuesday
Public Const LOCALE_SDAYNAME3 = &H2C        '  long name for Wednesday
Public Const LOCALE_SDAYNAME4 = &H2D        '  long name for Thursday
Public Const LOCALE_SDAYNAME5 = &H2E        '  long name for Friday
Public Const LOCALE_SDAYNAME6 = &H2F        '  long name for Saturday
Public Const LOCALE_SDAYNAME7 = &H30        '  long name for Sunday
Public Const LOCALE_SABBREVDAYNAME1 = &H31  '  abbreviated name for Monday
Public Const LOCALE_SABBREVDAYNAME2 = &H32  '  abbreviated name for Tuesday
Public Const LOCALE_SABBREVDAYNAME3 = &H33  '  abbreviated name for Wednesday
Public Const LOCALE_SABBREVDAYNAME4 = &H34  '  abbreviated name for Thursday
Public Const LOCALE_SABBREVDAYNAME5 = &H35  '  abbreviated name for Friday
Public Const LOCALE_SABBREVDAYNAME6 = &H36  '  abbreviated name for Saturday
Public Const LOCALE_SABBREVDAYNAME7 = &H37  '  abbreviated name for Sunday
Public Const LOCALE_SMONTHNAME1 = &H38      '  long name for January
Public Const LOCALE_SMONTHNAME2 = &H39      '  long name for February
Public Const LOCALE_SMONTHNAME3 = &H3A      '  long name for March
Public Const LOCALE_SMONTHNAME4 = &H3B      '  long name for April
Public Const LOCALE_SMONTHNAME5 = &H3C      '  long name for May
Public Const LOCALE_SMONTHNAME6 = &H3D      '  long name for June
Public Const LOCALE_SMONTHNAME7 = &H3E      '  long name for July
Public Const LOCALE_SMONTHNAME8 = &H3F      '  long name for August
Public Const LOCALE_SMONTHNAME9 = &H40      '  long name for September
Public Const LOCALE_SMONTHNAME10 = &H41     '  long name for October
Public Const LOCALE_SMONTHNAME11 = &H42     '  long name for November
Public Const LOCALE_SMONTHNAME12 = &H43     '  long name for December
Public Const LOCALE_SABBREVMONTHNAME1 = &H44 '  abbreviated name for January
Public Const LOCALE_SABBREVMONTHNAME2 = &H45 '  abbreviated name for February
Public Const LOCALE_SABBREVMONTHNAME3 = &H46 '  abbreviated name for March
Public Const LOCALE_SABBREVMONTHNAME4 = &H47 '  abbreviated name for April
Public Const LOCALE_SABBREVMONTHNAME5 = &H48 '  abbreviated name for May
Public Const LOCALE_SABBREVMONTHNAME6 = &H49 '  abbreviated name for June
Public Const LOCALE_SABBREVMONTHNAME7 = &H4A '  abbreviated name for July
Public Const LOCALE_SABBREVMONTHNAME8 = &H4B '  abbreviated name for August
Public Const LOCALE_SABBREVMONTHNAME9 = &H4C '  abbreviated name for September
Public Const LOCALE_SABBREVMONTHNAME10 = &H4D '  abbreviated name for October
Public Const LOCALE_SABBREVMONTHNAME11 = &H4E '  abbreviated name for November
Public Const LOCALE_SABBREVMONTHNAME12 = &H4F '  abbreviated name for December
Public Const LOCALE_SABBREVMONTHNAME13 = &H100F

Public Const LOCALE_SYSTEM_DEFAULT& = &H800
Public Const LOCALE_USER_DEFAULT& = &H400

Const cMAXLEN = 255

Private Declare PtrSafe Function apiGetLocaleInfo Lib "kernel32" _
    Alias "GetLocaleInfoA" (ByVal Locale As Long, _
    ByVal LCType As Long, ByVal lpLCData As String, _
    ByVal cchData As Long) As Long

''''
Function CountryName() As String
    Dim lngLocale As Long
    Dim strLCData As String, lngData As Long
    Dim lngX As Long
    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCOUNTRY, strLCData, lngData)
    
    If lngX <> 0 Then
        CountryName = Left$(strLCData, lngX - 1)
    End If
End Function
''''
Function fLocaleInfo(lngLCType As Long) As String
Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long

    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, lngLCType, _
                    strLCData, lngData)
    If lngX <> 0 Then
        fLocaleInfo = Left$(strLCData, lngX - 1)
    End If
End Function

Function fLOCALE_IMEASURE() As String
'  0 = metric, 1 = US

Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long

    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, _
                    strLCData, lngData)
    If lngX <> 0 Then
        fLOCALE_IMEASURE = Left$(strLCData, lngX - 1)
    End If
End Function

Function fListseparator() As String

'
'to use it
'cmb.AddItem fld.Name & fListseparator & iField_Caption
'

Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long

    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, strLCData, lngData)
    If lngX <> 0 Then
        fListseparator = Left$(strLCData, lngX - 1)
    End If
End Function
''''
Function LanguageName() As String
    Dim lngLocale As Long
    Dim strLCData As String, lngData As Long
    Dim lngX As Long
    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, strLCData, lngData)
    
    If lngX <> 0 Then
        LanguageName = Left$(strLCData, lngX - 1)
    End If
End Function
''''
Function LocalizedLanguageName() As String
    Dim lngLocale As Long
    Dim strLCData As String, lngData As Long
    Dim lngX As Long
    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE, strLCData, lngData)
    
    If lngX <> 0 Then
        LocalizedLanguageName = Left$(strLCData, lngX - 1)
    End If
End Function  

.

وتناديه هكذا:

if LanguageName & " (" & CountryName & ")" <> LocalizedLanguageName then
  msgbox "PC Language is : " & LocalizedLanguageName
end if  

.

 

جعفر

  • Like 2
  • Thanks 1
قام بنشر
17 ساعات مضت, jjafferr said:

السلام عليكم 🙂

 

مع اعتذاري للشباب ، فلم القي نظرة على مرفقاتكم 🙂

 

احفظ هذه الدالة باسم mod_Regional_Settings_info :

Option Compare Database
Option Explicit

' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Public Const LOCALE_ILANGUAGE = &H1         '  language id
Public Const LOCALE_SLANGUAGE = &H2         '  localized name of language
Public Const LOCALE_SENGLANGUAGE = &H1001   '  English name of language
Public Const LOCALE_SABBREVLANGNAME = &H3   '  abbreviated language name
Public Const LOCALE_SNATIVELANGNAME = &H4   '  native name of language
Public Const LOCALE_ICOUNTRY = &H5          '  country code
Public Const LOCALE_SCOUNTRY = &H6          '  localized name of country
Public Const LOCALE_SENGCOUNTRY = &H1002    '  English name of country
Public Const LOCALE_SABBREVCTRYNAME = &H7   '  abbreviated country name
Public Const LOCALE_SNATIVECTRYNAME = &H8   '  native name of country
Public Const LOCALE_IDEFAULTLANGUAGE = &H9  '  default language id
Public Const LOCALE_IDEFAULTCOUNTRY = &HA   '  default country code
Public Const LOCALE_IDEFAULTCODEPAGE = &HB  '  default code page
Public Const LOCALE_SLIST = &HC             '  list item separator
Public Const LOCALE_IMEASURE = &HD          '  0 = metric, 1 = US
Public Const LOCALE_SDECIMAL = &HE          '  decimal separator
Public Const LOCALE_STHOUSAND = &HF         '  thousand separator
Public Const LOCALE_SGROUPING = &H10        '  digit grouping
Public Const LOCALE_IDIGITS = &H11          '  number of fractional digits
Public Const LOCALE_ILZERO = &H12           '  leading zeros for decimal
Public Const LOCALE_SNATIVEDIGITS = &H13    '  native ascii 0-9
Public Const LOCALE_SCURRENCY = &H14        '  local monetary symbol
Public Const LOCALE_SINTLSYMBOL = &H15      '  intl monetary symbol
Public Const LOCALE_SMONDECIMALSEP = &H16   '  monetary decimal separator
Public Const LOCALE_SMONTHOUSANDSEP = &H17  '  monetary thousand separator
Public Const LOCALE_SMONGROUPING = &H18     '  monetary grouping
Public Const LOCALE_ICURRDIGITS = &H19      '  # local monetary digits
Public Const LOCALE_IINTLCURRDIGITS = &H1A  '  # intl monetary digits
Public Const LOCALE_ICURRENCY = &H1B        '  positive currency mode
Public Const LOCALE_INEGCURR = &H1C         '  negative currency mode
Public Const LOCALE_SDATE = &H1D            '  date separator
Public Const LOCALE_STIME = &H1E            '  time separator
Public Const LOCALE_SSHORTDATE = &H1F       '  short date format string
Public Const LOCALE_SLONGDATE = &H20        '  long date format string
Public Const LOCALE_STIMEFORMAT = &H1003    '  time format string
Public Const LOCALE_IDATE = &H21            '  short date format ordering
Public Const LOCALE_ILDATE = &H22           '  long date format ordering
Public Const LOCALE_ITIME = &H23            '  time format specifier
Public Const LOCALE_ICENTURY = &H24         '  century format specifier
Public Const LOCALE_ITLZERO = &H25          '  leading zeros in time field
Public Const LOCALE_IDAYLZERO = &H26        '  leading zeros in day field
Public Const LOCALE_IMONLZERO = &H27        '  leading zeros in month field
Public Const LOCALE_S1159 = &H28            '  AM designator
Public Const LOCALE_S2359 = &H29            '  PM designator
Public Const LOCALE_SDAYNAME1 = &H2A        '  long name for Monday
Public Const LOCALE_SDAYNAME2 = &H2B        '  long name for Tuesday
Public Const LOCALE_SDAYNAME3 = &H2C        '  long name for Wednesday
Public Const LOCALE_SDAYNAME4 = &H2D        '  long name for Thursday
Public Const LOCALE_SDAYNAME5 = &H2E        '  long name for Friday
Public Const LOCALE_SDAYNAME6 = &H2F        '  long name for Saturday
Public Const LOCALE_SDAYNAME7 = &H30        '  long name for Sunday
Public Const LOCALE_SABBREVDAYNAME1 = &H31  '  abbreviated name for Monday
Public Const LOCALE_SABBREVDAYNAME2 = &H32  '  abbreviated name for Tuesday
Public Const LOCALE_SABBREVDAYNAME3 = &H33  '  abbreviated name for Wednesday
Public Const LOCALE_SABBREVDAYNAME4 = &H34  '  abbreviated name for Thursday
Public Const LOCALE_SABBREVDAYNAME5 = &H35  '  abbreviated name for Friday
Public Const LOCALE_SABBREVDAYNAME6 = &H36  '  abbreviated name for Saturday
Public Const LOCALE_SABBREVDAYNAME7 = &H37  '  abbreviated name for Sunday
Public Const LOCALE_SMONTHNAME1 = &H38      '  long name for January
Public Const LOCALE_SMONTHNAME2 = &H39      '  long name for February
Public Const LOCALE_SMONTHNAME3 = &H3A      '  long name for March
Public Const LOCALE_SMONTHNAME4 = &H3B      '  long name for April
Public Const LOCALE_SMONTHNAME5 = &H3C      '  long name for May
Public Const LOCALE_SMONTHNAME6 = &H3D      '  long name for June
Public Const LOCALE_SMONTHNAME7 = &H3E      '  long name for July
Public Const LOCALE_SMONTHNAME8 = &H3F      '  long name for August
Public Const LOCALE_SMONTHNAME9 = &H40      '  long name for September
Public Const LOCALE_SMONTHNAME10 = &H41     '  long name for October
Public Const LOCALE_SMONTHNAME11 = &H42     '  long name for November
Public Const LOCALE_SMONTHNAME12 = &H43     '  long name for December
Public Const LOCALE_SABBREVMONTHNAME1 = &H44 '  abbreviated name for January
Public Const LOCALE_SABBREVMONTHNAME2 = &H45 '  abbreviated name for February
Public Const LOCALE_SABBREVMONTHNAME3 = &H46 '  abbreviated name for March
Public Const LOCALE_SABBREVMONTHNAME4 = &H47 '  abbreviated name for April
Public Const LOCALE_SABBREVMONTHNAME5 = &H48 '  abbreviated name for May
Public Const LOCALE_SABBREVMONTHNAME6 = &H49 '  abbreviated name for June
Public Const LOCALE_SABBREVMONTHNAME7 = &H4A '  abbreviated name for July
Public Const LOCALE_SABBREVMONTHNAME8 = &H4B '  abbreviated name for August
Public Const LOCALE_SABBREVMONTHNAME9 = &H4C '  abbreviated name for September
Public Const LOCALE_SABBREVMONTHNAME10 = &H4D '  abbreviated name for October
Public Const LOCALE_SABBREVMONTHNAME11 = &H4E '  abbreviated name for November
Public Const LOCALE_SABBREVMONTHNAME12 = &H4F '  abbreviated name for December
Public Const LOCALE_SABBREVMONTHNAME13 = &H100F

Public Const LOCALE_SYSTEM_DEFAULT& = &H800
Public Const LOCALE_USER_DEFAULT& = &H400

Const cMAXLEN = 255

Private Declare PtrSafe Function apiGetLocaleInfo Lib "kernel32" _
    Alias "GetLocaleInfoA" (ByVal Locale As Long, _
    ByVal LCType As Long, ByVal lpLCData As String, _
    ByVal cchData As Long) As Long

''''
Function CountryName() As String
    Dim lngLocale As Long
    Dim strLCData As String, lngData As Long
    Dim lngX As Long
    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCOUNTRY, strLCData, lngData)
    
    If lngX <> 0 Then
        CountryName = Left$(strLCData, lngX - 1)
    End If
End Function
''''
Function fLocaleInfo(lngLCType As Long) As String
Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long

    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, lngLCType, _
                    strLCData, lngData)
    If lngX <> 0 Then
        fLocaleInfo = Left$(strLCData, lngX - 1)
    End If
End Function

Function fLOCALE_IMEASURE() As String
'  0 = metric, 1 = US

Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long

    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, _
                    strLCData, lngData)
    If lngX <> 0 Then
        fLOCALE_IMEASURE = Left$(strLCData, lngX - 1)
    End If
End Function

Function fListseparator() As String

'
'to use it
'cmb.AddItem fld.Name & fListseparator & iField_Caption
'

Dim lngLocale As Long
Dim strLCData As String, lngData As Long
Dim lngX As Long

    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, strLCData, lngData)
    If lngX <> 0 Then
        fListseparator = Left$(strLCData, lngX - 1)
    End If
End Function
''''
Function LanguageName() As String
    Dim lngLocale As Long
    Dim strLCData As String, lngData As Long
    Dim lngX As Long
    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, strLCData, lngData)
    
    If lngX <> 0 Then
        LanguageName = Left$(strLCData, lngX - 1)
    End If
End Function
''''
Function LocalizedLanguageName() As String
    Dim lngLocale As Long
    Dim strLCData As String, lngData As Long
    Dim lngX As Long
    strLCData = String$(cMAXLEN, 0)
    lngData = cMAXLEN - 1
    lngX = apiGetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE, strLCData, lngData)
    
    If lngX <> 0 Then
        LocalizedLanguageName = Left$(strLCData, lngX - 1)
    End If
End Function  

.

وتناديه هكذا:

if LanguageName & " (" & CountryName & ")" <> LocalizedLanguageName then
  msgbox "PC Language is : " & LocalizedLanguageName
end if  

.

 

جعفر

وعليكم السلام 
جزاك الله خيراً اخى الكريم هذا هو المطلوب 
من فضلك محتاج اضع الكود عند فتح النموذج 
بحيث لو اللغه لا تساوى english(Canda)  يظهر رسالة مطلوب تغير اللغه 
كيفيه عمل هذا من فضلك 

قام بنشر
49 دقائق مضت, jjafferr said:

بدل الرسالة الحالية ، اعمل الرسالة اللي تريدها 🙂

 

جعفر

استاذ@jjafferr
 

Private Sub Form_Open(Cancel As Integer)
If LanguageName & " (" & CountryName & ")" <> "English(Canda)" Then
MsgBox "يرجى تغير اللغه لــ English(Canda)"
End If

End Sub
بيظهر الرسالة اين كانت اللغه حتى لو كانت مظبوطه 

قام بنشر

انت محتاج ترك مسافة بين كلمتين في كودك ، وتعديل كلمة كندا (بالانجليزي يا مرسي 😁)

 

جرب هذا الكود ، واخبرنا بالنتيجة في اسفل صفحة الكود :

Private Sub Form_Open(Cancel As Integer)

	debug.print LanguageName & " (" & CountryName & ")"

	If LanguageName & " (" & CountryName & ")" <> "English (Canada)" Then
		MsgBox "يرجى تغير اللغه لــ English(Canda)"
	End If

End Sub

 

جعفر

 

  • Like 1
  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information