How to detect brower culture info from JSON?

%3CLINGO-SUB%20id%3D%22lingo-sub-1476785%22%20slang%3D%22de-DE%22%3EHow%20to%20detect%20brower%20culture%20info%20from%20JSON%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1476785%22%20slang%3D%22de-DE%22%3E%3CP%3EHello%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20SharePoint%20List%20and%20want%20to%20change%20the%20view%20experience%20in%20dependency%20to%20the%20browser%20language%20settings.%20For%20example%20I%20have%20list%20columns%20Language_en%20and%20Language_de%20and%20I%20want%20to%20display%20the%20value%20either%20from%20column%20Language_de%20or%20from%20Language_en.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20assume%20that%20should%20be%20possible%20with%20JSON-Formatting%2C%20but%20I%20haven't%20found%20a%20way%20to%20detect%20the%20browser%20language.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECould%20you%20please%20help%20me%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChild%3C%2FP%3E%3CP%3EChris%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1476785%22%20slang%3D%22de-DE%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EResponsive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1529049%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20detect%20brower%20culture%20info%20from%20JSON%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1529049%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F704586%22%20target%3D%22_blank%22%3E%40Chris10250%3C%2FA%3E%26nbsp%3BHi%2C%20I%20was%20thinking%20that%20it%20could%20be%20done%20by%20quite%20strang%20hack.%3C%2FP%3E%3CP%3EThere%20is%20method%20to%20print%20localeDateString%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fcolumn-formatting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fcolumn-formatting%3C%2FA%3E).%20So%20your%20DE%20and%20EN%20format%20is%20different%2C%20so%20it's%20should%20be%20possible%20to%20parse%2Fdetect%20culture%20from%20%3CSPAN%3EtoLocaleString()%3C%2FSPAN%3E.%3C%2FP%3E%3CP%3EI%20don't%20like%20this%20solution%2C%20I%20didn't%20need%20to%20use%20it%20finally%2C%20but%20when%20I%20tried%20to%20find%20same%20solution%20I%20wasn't%20successful.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello Community,

 

I have a SharePoint List and want to change the View experience in dependency to the browser language settings. For example I have list columns Language_en and Language_de and I want to display the value either from column Language_de or from Language_en. 

I assume that should be possible with JSON-Formatting, but I haven't found a way to detect the browser language.

 

Could you please help me?

 

Kind regards

Chris

1 Reply

@Chris10250 Hi, I was thinking that it could be done by quite strang hack.

There is method to print localeDateString (https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting). So your DE and EN format is different, so it's should be possible to parse/detect culture from toLocaleString().

I don't like this solution, I didn't need to use it finally, but when I tried to find same solution I wasn't successful.