flow icon indicating copy to clipboard operation
flow copied to clipboard

Localization of Components

Open KangGeunSu opened this issue 5 years ago • 14 comments

The menus of "FLOW" have been localized.

However, it did not become a component.

Should I give you another option?

Note, it is applied as default.resource. FLOW is Other.resource.

Thank You~

KangGeunSu avatar Mar 08 '21 02:03 KangGeunSu

Additionally found "self.language" in "FN.websocket".

But I didn't find the part that sets "self.language" anywhere.

KangGeunSu avatar Mar 08 '21 02:03 KangGeunSu

Hi @KangGeunSu, do you mean localization for the components?

petersirka avatar Mar 08 '21 10:03 petersirka

Yes, I do

KangGeunSu avatar Mar 08 '21 10:03 KangGeunSu

Try to update flow.package (https://github.com/totaljs/flow) - I think that I have fixed localization.

petersirka avatar Mar 08 '21 11:03 petersirka

I tried after update, but still can't.

"client.language" is "undefined"

In my opinion, just use "client.req.$language".

"client.req.$language" comes out the value I set

KangGeunSu avatar Mar 09 '21 00:03 KangGeunSu

sorry, client.req.$language is seems to be the PC setting..

I would like it to be set to "LOCALIZE".

KangGeunSu avatar Mar 09 '21 01:03 KangGeunSu

Hi @KangGeunSu, yes - language can be set in LOCALIZE().

petersirka avatar Mar 09 '21 08:03 petersirka

LOCALIZE(function(req, res) { // if "query.language" will be undefined then the framework uses default resource return req.query.language; });

If you add the code above, then "Flow UI" is applied, but the inside of "Component" is still default.

http://localhost:8001/?language=ko Info, console... is to 정보, 콘솔 image

but, The inside of "Debug" remains the same. image

Also, client.language is undefined.

KangGeunSu avatar Mar 09 '21 09:03 KangGeunSu

my ko.resource

// debug.js
Tcyyznd      : 출력 타입
Tl8ltdw      : 예: 온도
T1h73owc     : 그룹 이름
.....
// index.html
T1cy4u       : 정보
T179lgs7     : 콘솔
Tygvmh7      : 에러

KangGeunSu avatar Mar 09 '21 09:03 KangGeunSu

Yes. I have added ?language= to the WebSocket address. I think that now it will work, please:

  • download flow.package https://github.com/totaljs/flow
  • restart app
  • give me a feedback

petersirka avatar Mar 09 '21 09:03 petersirka

I checked what came over.

In index.js, "client.language" should be changed to "client.query.language". client.language is undefined client.query.language is language of Value(ko)

KangGeunSu avatar Mar 09 '21 10:03 KangGeunSu

Or you can use "client.req.$language".

KangGeunSu avatar Mar 09 '21 11:03 KangGeunSu

@KangGeunSu my mistake :-( really sorry. I found a problem in Total.js framework because client.language wasn't assigned for WebSocket. Please download flow.package, I have assigned req.$language to translator. I have tested it and it works correctly.

petersirka avatar Mar 09 '21 11:03 petersirka

Has confirmed. Thank you all the time. Have a good day!

KangGeunSu avatar Mar 10 '21 00:03 KangGeunSu