diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 0033d98..b5cc081 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1166,10 +1166,10 @@ export default class ClientConnection { } } - public async getCityList() { + public async getCityList(language?: string) { try { return await this.doRpc( - new Protocol.GetCityListRequestEntity() + new Protocol.GetCityListRequestEntity(language) ); } catch (e) { console.error(e); diff --git a/src/components/WeatherSignalSourceDialog.vue b/src/components/WeatherSignalSourceDialog.vue index 4b7a297..e909eb9 100644 --- a/src/components/WeatherSignalSourceDialog.vue +++ b/src/components/WeatherSignalSourceDialog.vue @@ -227,7 +227,7 @@ import { defineComponent, ref, Ref, watch, computed, reactive } from "vue"; import { useStore } from "src/store"; import GlobalData from "src/common/GlobalData"; -import { useQuasar, date as DateHelper } from "quasar"; +import { useQuasar, date as DateHelper, Cookies } from "quasar"; import { useI18n } from "vue-i18n"; import WeatherWindowParamEntity from "src/entities/WeatherWindowParamEntity"; import { api } from "src/boot/axios"; @@ -412,8 +412,10 @@ export default defineComponent({ get_all_city_data = () => { const global_data = GlobalData.getInstance().getCurrentClient(); if (global_data) { + let language = Cookies.get("language"); + global_data - .getCityList() + .getCityList(language ?? "") .then((resposne) => { if (!resposne) { return; diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index e4b4e93..a328a68 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -2828,13 +2828,15 @@ export namespace Protocol { } export class GetCityListRequestEntity extends PacketEntity { - constructor(rpc_id = 0) { + constructor(language?: string, rpc_id = 0) { super(); super.command = Commands.kRpcGetCityList; super.flag = PacketEntity.FLAG_REQUEST; super.rpc_id = rpc_id; + this.language = language ?? ""; } timestamp = Date.now(); + language = ""; } export class GetCityListResponseEntity extends PacketEntity {