mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Updated language picker.
This commit is contained in:
		@@ -100,6 +100,10 @@ ComunicWeb.common.langs = {
 | 
				
			|||||||
     * @return {String} The string ready to show
 | 
					     * @return {String} The string ready to show
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    getTranslatedText: function(stringName, stringParams){
 | 
					    getTranslatedText: function(stringName, stringParams){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if(!this[this.__currentLang])
 | 
				
			||||||
 | 
					            return "Invalid language!";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Try to get string
 | 
					        //Try to get string
 | 
				
			||||||
        if(this[this.__currentLang][stringName])
 | 
					        if(this[this.__currentLang][stringName])
 | 
				
			||||||
            var string = this[this.__currentLang][stringName];
 | 
					            var string = this[this.__currentLang][stringName];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -62,27 +62,27 @@ ComunicWeb.components.langPicker = {
 | 
				
			|||||||
			class: "modal-body",
 | 
								class: "modal-body",
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
		//Display the list of languages
 | 
							//Display the list of language
 | 
				
			||||||
		var langs = [
 | 
					 | 
				
			||||||
			["fr", "Français"],
 | 
					 | 
				
			||||||
			["en", "English"]
 | 
					 | 
				
			||||||
		];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		var buttons = [];
 | 
							var buttons = [];
 | 
				
			||||||
		langs.forEach(function(lang){
 | 
							for(language in ComunicWeb.common.langs.list){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if(typeof language !== "string")
 | 
				
			||||||
 | 
									continue;
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								var info = ComunicWeb.common.langs.list[language];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			const button = createElem2({
 | 
								const button = createElem2({
 | 
				
			||||||
				appendTo: modalBody,
 | 
									appendTo: modalBody,
 | 
				
			||||||
				type: "div",
 | 
									type: "div",
 | 
				
			||||||
				class: "btn btn-default",
 | 
									class: "btn btn-default",
 | 
				
			||||||
				innerHTML: lang[1]
 | 
									innerHTML: info.local_name + " (" + info.name + ")"
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
			button.setAttribute("data-lang", lang[0]);
 | 
								button.setAttribute("data-lang", language);
 | 
				
			||||||
			buttons.push(button);
 | 
								buttons.push(button);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			add_space(modalBody);
 | 
								add_space(modalBody);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		});
 | 
							};
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
		//Modal footer
 | 
							//Modal footer
 | 
				
			||||||
		var modalFooter = createElem2({
 | 
							var modalFooter = createElem2({
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user