home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
boot
/
i386
/
root
/
usr
/
share
/
YaST2
/
modules
/
CustomDialogs.ycp
< prev
next >
Wrap
Text File
|
2006-11-29
|
2KB
|
59 lines
/**
* File: modules/CustomDialogs.ycp
* Module: yast2
* Summary: Installation mode
* Authors: Klaus Kaempf <kkaempf@suse.de>
*
* $Id: CustomDialogs.ycp 27936 2006-02-13 20:01:14Z olh $
*
*/
{
module "CustomDialogs";
global map load_file_locale (list<string> patterns, string file_path , string language)
{
string text = "";
string file = "";
integer i = 0;
while (i < size(patterns))
{
string p = patterns[i]:"";
string tmp = file_path + "/" + p;
if (!issubstring(p, "%"))
{
y2debug("no pattern");
y2debug("checking for %1", tmp );
text = (string)SCR::Read (.target.string, [tmp, ""]);
if (text != "")
break;
else
{
i = i + 1;
continue;
}
}
file = sformat (tmp, language);
y2debug("checking for %1", file );
text = (string)SCR::Read (.target.string, [file, ""]);
if (text != "")
break;
file = sformat (tmp, substring (language, 0, 2));
y2debug("checking for %1", file );
text = (string)SCR::Read (.target.string, [file, ""]);
if (text != "")
break;
file = sformat (tmp, "en");
y2debug("checking for %1", file );
text = (string)SCR::Read (.target.string, [file, ""]);
if (text != "")
break;
i = i + 1;
}
return $["text":text, "file":file];
}
}