Skip to content

Commit

Permalink
Fixed language issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f committed Sep 22, 2023
1 parent 5893c79 commit 5a18ff1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions internalsdk/session_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const SESSION_MODEL_METHOD_SET_DNS_SERVER = "setDNSServer"
const SESSION_MODEL_METHOD_SET_PROVIDER = "setProvider"
const SESSION_MODEL_METHOD_SET_EMAIL = "setEmail"
const SESSION_MODEL_METHOD_SET_PRO_USER = "setProUser"
const SESSION_MODEL_METHOD_SET_LOCAL = "setLocal"
const SESSION_MODEL_METHOD_SET_LOCAL = "setLanguage"
const SESSION_MODEL_METHOD_SET_CURRENCY = "setCurrency"
const SESSION_MODEL_METHOD_ACCEPT_TERMS = "acceptTerms"
const SESSION_MODEL_METHOD_SET_STORE_VERSION = "setStoreVersion"
Expand Down Expand Up @@ -188,7 +188,7 @@ func (s *SessionModel) InvokeMethod(method string, arguments minisql.Values) (*m
}
case SESSION_MODEL_METHOD_SET_LOCAL:
local := arguments.Get(0)
err := setLocale(s.baseModel, local.String())
err := setLanguage(s.baseModel, local.String())
if err != nil {
return nil, err
} else {
Expand Down Expand Up @@ -420,7 +420,7 @@ func (s *SessionModel) Locale() (string, error) {
return string(locale), nil
}

func setLocale(m *baseModel, langCode string) error {
func setLanguage(m *baseModel, langCode string) error {
pathdb.Mutate(m.db, func(tx pathdb.TX) error {
pathdb.Put[string](tx, LANG, langCode, "")
return nil
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4cde1e23c4c277b696c6e6e9589bbb76fb18fd3a

COCOAPODS: 1.12.1
COCOAPODS: 1.11.3
5 changes: 2 additions & 3 deletions ios/Runner/Lantern/Db/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ class QueryResult: NSObject, MinisqlResultProtocol {
}

class RowData: NSObject, MinisqlRowsProtocol {

let rows: [Statement.Element]
let rows: [Statement.Element]
var currentIndex: Int = -1
private let syncQueue = DispatchQueue(label: "com.yourapp.RowData.syncQueue")
private let syncQueue = DispatchQueue(label: "com.lantern.RowData.syncQueue")


init(rows: [Statement.Element]) {
Expand Down
11 changes: 6 additions & 5 deletions lib/account/language.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ class Language extends StatelessWidget {
padVertical: true,
body: sessionModel
.language((BuildContext context, String currentLang, Widget? child) {
print("Language code $currentLang");
return ListView.builder(
// Splint language by just code
final countryCode= currentLang.split('_')[0];
return ListView.builder(
itemCount: languages.length,
itemBuilder: (BuildContext context, int index) {
var lang = languages[index];
var lang = languages[index].split('_')[0];
return RadioListTile<String>(
activeColor: pink4,
contentPadding: const EdgeInsetsDirectional.all(0),
tileColor: lang == currentLang ? grey2 : transparent,
tileColor: lang == countryCode ? grey2 : transparent,
dense: true,
title: CText(
toBeginningOfSentenceCase(displayLanguage(lang))!,
style: tsBody1,
),
value: lang,
groupValue: currentLang,
groupValue: countryCode,
onChanged: (String? value) async {
await sessionModel.setLanguage(lang);
Navigator.pop(context);
Expand Down

0 comments on commit 5a18ff1

Please sign in to comment.