Delphi 关于多语言:如何获取当前系统语言


本文整理自网络,侵删。

 
uses FMX.Platform;

 

function TForm2.GetCurrentLan: string;
var
  LocServ: IFMXLocaleService;
begin
  //读取当前语言,测试通过。
  if TPlatformServices.Current.SupportsPlatformService(IFMXLocaleService, IInterface(LocServ)) then
    Result := LocServ.GetCurrentLangID;

end;

以上代码,Windows 和 Android 底下测试通过。iOS 想来也不会有问题。

参考: Language on iOS/Android
――――――――――――――――

原文链接:https://blog.csdn.net/pcplayer/article/details/79578258

相关阅读 >>

Delphi 解决idtcpclient和idtcpserver通信中文乱码问题

Delphi tms web core twebhttprequest使用

Delphi idhttp的基本用法

Delphi判断某个程序是否已经启动

Delphi systemparametersinfo 用法

Delphi 坐标截图如何实现

Delphi 检查当前用户权限

Delphi字符串拆分(字符数限制)

Delphi tedit 编辑框 中文使用说明

Delphi tcomport控件从串品读取数据

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...