Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-macos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-macos
Commits
7d507b45
Commit
7d507b45
authored
4 years ago
by
Kateryna Kostiuk
Browse files
Options
Downloads
Patches
Plain Diff
translation: fix loading
Change-Id: I5a6647ffca733af93a56767d3db697b86d00f3c7
parent
3dc963d3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
genXcodeProj.sh
+1
-1
1 addition, 1 deletion
genXcodeProj.sh
src/main.mm
+11
-9
11 additions, 9 deletions
src/main.mm
with
12 additions
and
10 deletions
genXcodeProj.sh
+
1
−
1
View file @
7d507b45
#!/bin/bash
#!/bin/bash
cd
../install/lrc
/lib/cmake/LibRingClient/
cd
../install/lrc
export
CMAKE_PREFIX_PATH
=
$(
brew
--prefix
qt5
)
export
CMAKE_PREFIX_PATH
=
$(
brew
--prefix
qt5
)
export
CMAKELRCPATH
=
`
pwd
`
export
CMAKELRCPATH
=
`
pwd
`
cd
-
cd
-
...
...
This diff is collapsed.
Click to expand it.
src/main.mm
+
11
−
9
View file @
7d507b45
...
@@ -43,16 +43,18 @@ int main(int argc, const char *argv[]) {
...
@@ -43,16 +43,18 @@ int main(int argc, const char *argv[]) {
dir
.
cdUp
();
dir
.
cdUp
();
//We need to check if primary language is an English variant (en, en-CA etc...) before installing a translator
const
auto
localeName
=
QLocale
::
system
().
name
();
NSString
*
lang
=
[[
NSLocale
preferredLanguages
]
objectAtIndex
:
0
];
const
auto
localeLang
=
localeName
.
split
(
'_'
)[
0
];
if
(
!
[
lang
rangeOfString
:
@"en"
].
location
!=
NSNotFound
)
{
auto
langPath
=
dir
.
absolutePath
()
+
"/Contents/Resources/QtTranslations/lrc_"
+
localeLang
+
".qm"
;
QTranslator
translator
;
auto
localePath
=
dir
.
absolutePath
()
+
"/Contents/Resources/QtTranslations/lrc_"
+
localeName
+
".qm"
;
if
(
translator
.
load
(
QLocale
::
system
(),
"lrc"
,
"_"
,
dir
.
absolutePath
()
+
"/Resources/QtTranslations"
))
{
QTranslator
lrcTranslatorLang
;
app
->
install
Translator
(
&
t
ranslator
)
;
Q
Translator
lrcT
ranslator
Locale
;
}
else
{
if
(
localeName
!=
localeLang
)
{
NSLog
(
@"Couldn't load qt translator"
);
if
(
lrcTranslatorLang
.
load
(
langPath
))
}
app
->
installTranslator
(
&
lrcTranslatorLang
);
}
}
if
(
lrcTranslatorLocale
.
load
(
localePath
))
app
->
installTranslator
(
&
lrcTranslatorLocale
);
GlobalInstances
::
setPixmapManipulator
(
std
::
unique_ptr
<
Interfaces
::
ImageManipulationDelegate
>
(
new
Interfaces
::
ImageManipulationDelegate
()));
GlobalInstances
::
setPixmapManipulator
(
std
::
unique_ptr
<
Interfaces
::
ImageManipulationDelegate
>
(
new
Interfaces
::
ImageManipulationDelegate
()));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment