function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nikhil Gupta 202Nikhil Gupta 202 

custom label inside a community login page

I have created a custom login visualforce page for my community. I also created couple of custom labels. When I am swtiching the language the translation are not coming up it is showing english only.

I have added the translation.

Any suggestion what I am missing?

SwethaSwetha (Salesforce Developers) 
HI Nikhil,
Have you added all the desired languages in this click path of your community?
Community Builder -> Settings -> Language -> Go to Site.com to select languages and add all the desired languages > publish the site.

Thanks
Nikhil Gupta 202Nikhil Gupta 202
Yes, I have added them. I have other lightning components with custom labels which are working fine.
Just the Community login visualforce page is having issue.
SwethaSwetha (Salesforce Developers) 
Thanks, Nikhil. Can you provide a simplified code snippet that I can use to repro this behaviour in my org?Also do you see any errors in this non-working scenario?
Nikhil Gupta 202Nikhil Gupta 202

<apex:page id="loginPage"  language = "{!$CurrentPage.parameters.language}">
<html>
       <label id="label_user_type">{!$Label.user_type}</label>
       <h6>{!$Label.login}</h6>
</html>
</apex:page>

There is no error, English text is coming in all languages .

SwethaSwetha (Salesforce Developers) 
I've been working on reproducing this behaviour in my org. Can you clarify how the user is selecting the language? Are you having the standard language selector component on the login page? Can you please provide a screenshot if possible.Thanks
sje lseksje lsek
Hey, Can I embed this scirpt with my small content based wbesit that hosted on WordPress? I want to use use for my APK Blog (https://clashroyaleapk.net/).
Nicolai Nonnenbroich 9Nicolai Nonnenbroich 9

Not sure if this has been solved, but since you're working with Visualforce, the syntax for referencing custom labels is different:

In Apex use the System.Label.Label_name syntax.
In Visualforce, use the $Label global variable.
In Aura components, use the $Label.c.labelName syntax for the default namespace or $Label.namespace.labelName if your org has a namespace or to access a label in a managed package.
In Lightning web components, import the label using the @salesforce/label/namespace.Label_name syntax.
In Lightning App Builder component labels and attributes, use the {!$Label.customLabelName} expression.

https://help.salesforce.com/s/articleView?id=sf.cl_about.htm&type=5