Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

musicaldesigner

Member
  • Posts

    36
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I know this is two years later but I found this worked on blogs when I injected into "POST BLOG ITEM CODE INJECTION": https://answers.squarespace.com/questions/11258/how-to-change-the-date-format.html
  2. I just used a Number field instead of Phone, since the phone format in Europe is different than the US and Canada (###-###-####). You can change the name for the number field in the form settings.
  3. @groundcontact Thank you for the code, it works great! I was trying to figure out how to replace and/or remove the captions for addresses as well (Address 1, Address 2, State/Province, Zip/Postal Code, City, Country). It worked fine, except for "State/Province" and "Zip/Postal Code" because the '/' couldn't be typed into your code as is. I'm not a programmer, but after some research I finally figured it out. I'll explain below in case anyone is still trying to figure this out. @Solo. I used three separate functions to remove 'State' , '/' , and 'Province' since they do not use this label in Norway, by replacing them with nothing (""). For '/' I had to insert a \ before it. I believe it is similar in other parts of Europe, where State/Province is not necessary. The code below removes this easily. $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/State/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/\//ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Province/ig, "")); } }); I did the same for Zip/Postal Code by replacing 'Zip' with 'Postnummer' and removing 'Postal Code' separately. The previous function above already removed all the forward slashes in the form '/'. $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Zip/ig, "Postnummer")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Postal Code/ig, "")); } }); Here is @groundcontact's entire code again, with my address labels included within, and a few other modifications: <script type="text/javascript"> function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { if (oldonload) { oldonload(); } func(); }; } } addLoadEvent(function () { // Translate form captions $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/First Name/ig, "Fornavn")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Last Name/ig, "Etternavn")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Address 1/ig, "Adresse 1")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Address 2/ig, "Adresse 2")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/City/ig, "Sted")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/State/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/\//ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Province/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Zip/ig, "Postnummer")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Postal Code/ig, "")); } }); $('.caption').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Country/ig, "Land")); } }); // Translate blog page items $('.pagination').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Newer/ig, "Nyere")); } }); $('.pagination').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Older/ig, "Eldre")); } }); $('.tags-cats').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/tags/ig, "etiketter")); } }); $('.excerpt').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Read More/ig, "Les mer")); } }); $('.sqs-comment-link.sqs-disqus-comment-link').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Comment/ig, "Kommentere")); } }); // Translate dates $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/January/ig, "Januar")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/February/ig, "Februar")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/March/ig, "Mars")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/April/ig, "April")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/May/ig, "Mai")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/June/ig, "Juni")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/July/ig, "Juli")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/August/ig, "August")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/September/ig, "September")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/October/ig, "Oktober")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/November/ig, "November")); } }); $('.post-meta.author-date').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/December/ig, "Desember")); } }); // Translate site-wide items $('.back-to-top').each(function (i, el) { if ($(el).html() != "") { $(el).html($(el).html().replace(/Back to Top/ig, "Tilbake til toppen")); } }); $('.icon-comments').attr('title', 'Kommentarer'); $('.icon-share').attr('title', 'Del'); $('.search-input').attr('placeholder', 'Søke'); }); </script> I also modified the .search-input function because it was not working for me. Instead of 'value placeholder' I just used 'placeholder'.
  4. I just figured out why the language menu was not appearing! I am still a novice at code. As I went over your explanation I realized I needed to change "output a menu" to "true" instead of "false." Such a simple solution! Thanks again @softworks for sharing a great solution to making a multilingual site.
  5. Hi @softworks, this code looks great, and for the most part it is working for me. However, the langNavigation (as I think it is called) does not show up in my website. Is there something wrong in the code? I am using Horizon which is a variant of Pacific so it should work exactly how you wrote it, except that I changed DE to NO throughout the code. It successfully hides the links for the other language, but there is no language selector menu showing on the right. I also already uploaded the flag images and copied your exact CSS into my CSS editor. Here is my website, under construction still: https://bergen-adventistkirke.squarespace.com. I currently added a different dropdown menu with links in order to navigate to the languages for now. But it does not look like your selector menu, detached from the main navigation on the right, and I haven't figured out how to add flags. Any help to get the language selector menu functioning how you made it would be greatly appreciated! Thanks!
  6. Hi @softworks, this code looks great, and for the most part it is working for me. However, the langNavigation (as I think it is called) does not show up in my website. Is there something wrong in the code? I am using Horizon which is a variant of Pacific so it should work exactly how you wrote it, except that I changed DE to NO. It successfully hides the links for the other language, but there is no language selector menu showing. Here is my website, under construction still: https://bergen-adventistkirke.squarespace.com. The English one works best right now as I still need to fix the other.
×
×
  • Create New...