Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
854c2e46
Commit
854c2e46
authored
Apr 29, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lng, return status from get()
parent
74208f57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
src/lib/co/src/co_lng.cpp
src/lib/co/src/co_lng.cpp
+5
-3
src/lib/co/src/co_lng.h
src/lib/co/src/co_lng.h
+1
-1
src/msg/co/src/co_lng_msg.msg
src/msg/co/src/co_lng_msg.msg
+1
-0
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+7
-2
No files found.
src/lib/co/src/co_lng.cpp
View file @
854c2e46
...
...
@@ -562,24 +562,26 @@ void Lng::get_uid( char *in, char *out)
strcpy
(
out
,
result
);
}
void
Lng
::
set
(
char
*
language
)
pwr_tStatus
Lng
::
set
(
char
*
language
)
{
pwr_tStatus
sts
;
lng_eLanguage
l
=
str_to_lang
(
language
);
if
(
l
!=
lng_eLanguage_
)
{
sts
=
set
(
l
);
if
(
EVEN
(
sts
))
return
;
if
(
EVEN
(
sts
))
return
sts
;
}
setlocale
(
LC_ALL
,
lang_to_locale
(
l
));
setlocale
(
LC_NUMERIC
,
"POSIX"
);
setlocale
(
LC_TIME
,
"en_US"
);
return
1
;
}
pwr_tStatus
Lng
::
set
(
lng_eLanguage
language
)
{
if
(
lang
==
language
)
return
1
;
return
LNG__ALREADYSET
;
if
(
language
==
lng_eLanguage_en_US
)
{
lang
=
language
;
...
...
src/lib/co/src/co_lng.h
View file @
854c2e46
...
...
@@ -286,7 +286,7 @@ class Lng {
static
void
unload
();
static
pwr_tStatus
set
(
lng_eLanguage
language
);
static
lng_eLanguage
current
()
{
return
lang
;}
static
void
set
(
char
*
language
);
static
pwr_tStatus
set
(
char
*
language
);
static
char
*
get
(
int
item
)
{
return
items
[
lang
][
item
];}
static
char
*
get
(
lng_eLanguage
language
,
int
item
)
...
...
src/msg/co/src/co_lng_msg.msg
View file @
854c2e46
...
...
@@ -44,5 +44,6 @@ eof <End of file> /error
diffcoding <Coding of global and local translationfiles differ> /error
file <Unable to open file> /error
includemismatch <Include statement mismatch> /error
alreadyset <Specified language already set> /error
.end
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
854c2e46
...
...
@@ -1044,6 +1044,7 @@ static int xnav_set_func( void *client_data,
{
char
language_str
[
80
];
ApplListElem
*
elem
;
pwr_tStatus
sts
;
// Command is "SET LANGUAGE"
if
(
EVEN
(
dcli_get_qualifier
(
"dcli_arg2"
,
language_str
,
sizeof
(
language_str
))))
{
...
...
@@ -1051,8 +1052,12 @@ static int xnav_set_func( void *client_data,
return
XNAV__HOLDCOMMAND
;
}
cdh_ToLower
(
language_str
,
language_str
);
Lng
::
set
(
language_str
);
sts
=
Lng
::
set
(
language_str
);
if
(
EVEN
(
sts
))
{
xnav
->
message
(
' '
,
XNav
::
get_message
(
sts
));
return
XNAV__SUCCESS
;
}
// Set new coding to all graphs
for
(
elem
=
xnav
->
appl
.
root
;
elem
;
elem
=
elem
->
next
)
{
if
(
elem
->
type
==
applist_eType_Graph
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment