Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sobot_android
Sobot_module_Dev
Commits
0c925e35
Commit
0c925e35
authored
Nov 21, 2024
by
郭倩芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 多语言
parent
8d980ec5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
SobotCommonHttpUtils.java
...ain/java/com/sobot/common/login/SobotCommonHttpUtils.java
+1
-1
SobotLoginTools.java
...src/main/java/com/sobot/common/login/SobotLoginTools.java
+18
-1
strings.xml
sobot_common/src/main/res/values-en/strings.xml
+0
-0
strings.xml
sobot_common/src/main/res/values/strings.xml
+0
-0
No files found.
sobot_common/src/main/java/com/sobot/common/login/SobotCommonHttpUtils.java
View file @
0c925e35
...
...
@@ -49,7 +49,7 @@ public class SobotCommonHttpUtils {
private
static
String
getLanguage
(
Context
context
)
{
String
languageStr
=
""
;
if
(
SobotLoginTools
.
getInstance
().
getServiceInfo
()
!=
null
)
{
languageStr
=
SobotStringUtils
.
checkStringIsNull
(
SobotLoginTools
.
getInstance
().
getServiceInfo
().
getService
Language
());
languageStr
=
SobotStringUtils
.
checkStringIsNull
(
SobotLoginTools
.
getInstance
().
getServiceInfo
().
getService
WorkbenchLang
());
}
return
languageStr
;
}
...
...
sobot_common/src/main/java/com/sobot/common/login/SobotLoginTools.java
View file @
0c925e35
package
com
.
sobot
.
common
.
login
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.sobot.common.login.callback.SobotResultBlock
;
import
com.sobot.common.login.callback.SobotResultCode
;
...
...
@@ -25,6 +26,7 @@ import com.sobot.utils.SobotSharedPreferencesUtil;
import
com.sobot.utils.SobotStringUtils
;
import
org.json.JSONArray
;
import
org.w3c.dom.Text
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -50,6 +52,7 @@ public class SobotLoginTools {
private
SobotServiceInfoModel
mServiceInfoModel
;
private
String
lang
=
""
;
public
SobotServiceInfoModel
getServiceInfo
()
{
if
(
mServiceInfoModel
==
null
)
{
...
...
@@ -57,6 +60,18 @@ public class SobotLoginTools {
}
return
mServiceInfoModel
;
}
public
String
getServicLang
(){
if
(
lang
!=
null
&&
TextUtils
.
isEmpty
(
lang
))
{
SobotServiceInfoModel
infoModel
=
getServiceInfo
();
if
(
infoModel
!=
null
)
{
lang
=
infoModel
.
getServiceWorkbenchLang
();
}
}
if
(
lang
==
null
||
TextUtils
.
isEmpty
(
lang
)){
lang
=
"zh"
;
}
return
lang
;
}
private
List
<
ServiceFunctionVoModel
>
functionVoModelList
;
...
...
@@ -75,8 +90,10 @@ public class SobotLoginTools {
ServiceInfoManager
.
getInstance
().
deleteAll
();
mServiceInfoModel
=
newServiceInfo
;
if
(
mServiceInfoModel
!=
null
)
{
lang
=
mServiceInfoModel
.
getServiceWorkbenchLang
();
ServiceInfoManager
.
getInstance
().
insert
(
mServiceInfoModel
);
}
else
{
lang
=
""
;
ServiceInfoManager
.
getInstance
().
deleteAll
();
}
}
...
...
@@ -714,7 +731,7 @@ public void requestLanguage(String host,String token, String language ){
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
headerMap
.
put
(
"authorization"
,
"Bearer "
+
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
getToken
()));
headerMap
.
put
(
"temp-id"
,
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
getToken
()));
headerMap
.
put
(
"language"
,
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
getService
Language
()));
headerMap
.
put
(
"language"
,
SobotStringUtils
.
checkStringIsNull
(
infoModel
.
getService
WorkbenchLang
()));
headerMap
.
put
(
"from"
,
"2"
);
SobotHttpUtils
.
doGet
(
cancelTag
,
host
+
"/chat-sdk/sdk/admin/v2/appEnter"
,
8000
,
params
,
headerMap
,
new
HttpBaseUtils
.
StringCallBack
()
{
@Override
...
...
sobot_common/src/main/res/values-en/strings.xml
View file @
0c925e35
This diff is collapsed.
Click to expand it.
sobot_common/src/main/res/values/strings.xml
View file @
0c925e35
This diff is collapsed.
Click to expand it.
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