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
c809273f
Commit
c809273f
authored
Apr 17, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locale set when language is set
parent
8a36f763
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
src/lib/co/src/co_lng.cpp
src/lib/co/src/co_lng.cpp
+23
-1
src/lib/co/src/co_lng.h
src/lib/co/src/co_lng.h
+2
-1
No files found.
src/lib/co/src/co_lng.cpp
View file @
c809273f
/**
* Proview $Id: co_lng.cpp,v 1.1
1 2005-12-21 08:30:59
claes Exp $
* Proview $Id: co_lng.cpp,v 1.1
2 2007-04-17 13:55:58
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -20,6 +20,7 @@
#include <string.h>
#include <stdio.h>
#include <locale.h>
#include "pwr.h"
...
...
@@ -65,6 +66,23 @@ char *Lng::lang_to_str( lng_eLanguage language)
return
result
;
}
char
*
Lng
::
lang_to_locale
(
lng_eLanguage
language
)
{
static
char
result
[
20
];
switch
(
language
)
{
case
lng_eLanguage_sv_se
:
strcpy
(
result
,
"sv_SE"
);
break
;
case
lng_eLanguage_de_de
:
strcpy
(
result
,
"de_DE"
);
break
;
default:
strcpy
(
result
,
"en_US"
);
}
return
result
;
}
static
int
compKey
(
tree_sTable
*
tp
,
tree_sNode
*
x
,
tree_sNode
*
y
)
{
lang_sKey
*
xKey
=
(
lang_sKey
*
)
(
tp
->
keyOffset
+
(
char
*
)
x
);
...
...
@@ -331,6 +349,8 @@ void Lng::set( char *language)
lng_eLanguage
l
=
str_to_lang
(
language
);
if
(
l
!=
lng_eLanguage_
)
set
(
l
);
setlocale
(
LC_ALL
,
lang_to_locale
(
l
));
}
void
Lng
::
set
(
lng_eLanguage
language
)
...
...
@@ -343,6 +363,8 @@ void Lng::set( lng_eLanguage language)
unload
();
else
read
();
setlocale
(
LC_ALL
,
lang_to_locale
(
lang
));
}
...
...
src/lib/co/src/co_lng.h
View file @
c809273f
/**
* Proview $Id: co_lng.h,v 1.
6 2005-09-26 08:03:02
claes Exp $
* Proview $Id: co_lng.h,v 1.
7 2007-04-17 13:55:58
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -135,6 +135,7 @@ class Lng {
static
void
get_uid
(
char
*
in
,
char
*
out
);
static
lng_eLanguage
str_to_lang
(
char
*
str
);
static
char
*
lang_to_str
(
lng_eLanguage
language
);
static
char
*
lang_to_locale
(
lng_eLanguage
language
);
};
#if defined __cplusplus
...
...
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