web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Reusing my javascript ...
Power Pages
Unanswered

Reusing my javascript codes for multiple language setting

(0) ShareShare
ReportReport
Posted on by 142
Hi,
 
How can i reuse my JS codes if i enabled multi language support. right now, i only have requirements for English and French and just copy the same code on each language's js file.
 
tried to upload a js file as web file though by default it is blocked. i dont want to unblock it under settings if another way is possible.
Categories:
I have the same question (0)
  • Suggested answer
    Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at
    Remove it from the restricted file list while you upload the file and then put it back.
     
    The other way you can work with multiple languages is to put the bits that are translated into JavaScript variables in a Web Template. Use Content Snippets to contain the translation, then your code substitutes in the JS variable. 
    var myVar = "{{ snippets['contentsnippetname'] }}";
     
    or put all the JS in a Web Template (wrap in script tags like you would in a HTML page) and use content snippets like above, and then include that template in the Web Template or page copy behind your Web Page  using the 'include' liquid tag
     
    Edit: for each language you have a Content Snippet with the same Name, but different language set.
  • Suggested answer
    surya narayanan Profile Picture
    102 on at
    Hi,
     
    I have provided my response in the attached file.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard