What makes websitestrings load to a website?

What is it that makes websitestring(Text) that has a heritance of WebSiteStringDefinition to appear for a website in backoffice? We are using the accelerator and we have 7 websites configured, it works for 6 of them, but on the 7th i get no website strings. Yes i could export XML from one of the other site and import it but i would like to solve this with code.

Litium version: 5.6.2

Your websitestring class need to inherit from WebSiteStringDefinition and then you override the method IEnumerable<WebSite> Setup() and make it return all websites you want your strings created on.

So if you want your strings on every site your Setup()method should look like this to return all sites:

protected override IEnumerable<WebSite> Setup()
{
   return ModuleCMS.Instance.WebSites;
}
public class CustomWebsiteStrings : WebSiteStringDefinition
{
    [Translation("Return shipping", "en-gb")]
    [Translation("Returfrakt", "sv-se")]
    public virtual string ReturnShipping { get; set; }

    protected override IEnumerable<WebSite> Setup()
    {
        return ModuleCMS.Instance.WebSites;
    }
}

This is how my class looks like. And now if I create a new website that website doesnt get this text property. I’ve also tried rebuilding searchindex and restarting the IIS.

Ok, try removing the flag in the database that this file is already executed to make it run again:

DELETE FROM Common.Setting WHERE [Key] LIKE '%CustomWebsiteStrings%

After that restart the application.

Edit: noted that you are using version 5 so change Common.Setting to dbo.Foundation_Settings as this was changed in version 6.