From: liushuyu <liushuyu@aosc.io>
Signed-off-by: liushuyu <liushuyu@aosc.io>
---
tools/import-messages.pl | 6 +++---
tools/split-messages.pl | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/import-messages.pl b/tools/import-messages.pl
index 4c13a85..fe23842 100644
--- a/tools/import-messages.pl
+++ b/tools/import-messages.pl
@@ -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 );
diff --git a/tools/split-messages.pl b/tools/split-messages.pl
index 0504b24..1c78fd2 100644
--- a/tools/split-messages.pl
+++ b/tools/split-messages.pl
@@ -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 );
--
2.28.0
_______________________________________________
netsurf-dev mailing list -- netsurf-dev@netsurf-browser.org
To unsubscribe send an email to netsurf-dev-leave@netsurf-browser.org
No comments:
Post a Comment