mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-21 22:11:22 +03:00
utils: support xx_YY format language code
Signed-off-by: liushuyu <liushuyu@aosc.io>
This commit is contained in:
parent
1ea47f9caf
commit
b0b8f2f875
@ -81,7 +81,7 @@ sub main ()
|
||||
}
|
||||
|
||||
# double check the options are sane (and we weren't asked for the help)
|
||||
if( !$opt_ok || $opt{help} || $opt{lang} !~ /^[a-z]{2}$/ )
|
||||
if( !$opt_ok || $opt{help} || $opt{lang} !~ /^[a-z]{2}(?:_[A-Z]{2})?$/ )
|
||||
{
|
||||
usage();
|
||||
}
|
||||
@ -97,7 +97,7 @@ sub main ()
|
||||
|
||||
my( $lang, $plat, $key );
|
||||
|
||||
if( /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
|
||||
if( /(^[a-z]{2}(?:_[A-Z]{2})?)\.([^.]+)\.([^:]+):/ )
|
||||
{
|
||||
( $lang, $plat, $key ) = ( $1, $2, $3 );
|
||||
}
|
||||
@ -246,7 +246,7 @@ sub parser ()
|
||||
|
||||
while ( <$stream> )
|
||||
{
|
||||
if( /^([a-z]{2})\.([^.]+)\.([^:]+):(.*)/ )
|
||||
if( /(^[a-z]{2}(?:_[A-Z]{2})?)\.([^.]+)\.([^:]+):(.*)/ )
|
||||
{
|
||||
my( $lang, $plat, $key, $val ) = ( $1, $2, $3, $4 );
|
||||
|
||||
|
@ -85,7 +85,7 @@ sub main ()
|
||||
}
|
||||
|
||||
# double check the options are sane (and we weren't asked for the help)
|
||||
if( !$opt_ok || $opt{help} || $opt{lang} !~ /^[a-z]{2}$/ || $opt{dlang} !~ /^[a-z]{2}$/ )
|
||||
if( !$opt_ok || $opt{help} || $opt{lang} !~ /^[a-z]{2}(?:_[A-Z]{2})?$/ || $opt{dlang} !~ /^[a-z]{2}(?:_[A-Z]{2})?$/ )
|
||||
{
|
||||
usage();
|
||||
}
|
||||
@ -109,7 +109,7 @@ sub main ()
|
||||
/^\s*$/ && next;
|
||||
|
||||
# only parsing things that look like message lines:
|
||||
if( /^([a-z]{2}).([^.]+).([^:]+):(.*)/ )
|
||||
if( /^([a-z]{2}(?:_[A-Z]{2})?).([^.]+).([^:]+):(.*)/ )
|
||||
{
|
||||
my( $lang, $plat, $key, $val ) = ( $1, $2, $3, $4 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user