1.创建一个全局的HASH表
initialization
g_hash := THashedStringList.Create;
finalization
FreeAndNil(g_hash);
2.往全局HASH表里面写入 INI文件的指定小节(字符串定义集中放在一个小节里面)读取到的所有行,每次更选择语言以后都要执行此操作。
ini.ReadSectionValues('messages', g_hash);
3.所有需要使用字符串变量从这个全局HASH表中检索
function GetHashStr(const key: string): string;
begin
Result := GetHash.Values[key];
end;