Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

LanguageFiles not loading; best practices?

Vote:
 

Hello all,

I am migrating from CMS 11 to 12, and cannot track down why my property and content type names language files are being ignored.  I'm not seeing any CMS 12/.NET Core specific changes in the documentation.  Maybe I have inadvertently excluded a piece.

  • I still have services.AddEmbeddedLocalization<Startup>() in my Startup. 
  • I have added the episerver.localization settings to appsettings.json, and have also tried putting it into a web.config as it was previously.  I updated the providers.type from EPiServer.Framework.AspNet to AspNetCore.
  • We did not use a customized localization provider previously.

We have no actual need for localization in the CMS UI, but use the XML files.  I know I could move the text from XML to code, but because of our extensive use of inheritance, it would require overriding properties just for changes to names/descriptions.  And the moving would be very large.

On a side note, are there any plans to move things from .config/xml files to json?

Any insight would be appreciated!

Thanks,

Kevin

#294497
Edited, Jan 11, 2023 15:19
Vote:
 

You should only need services.AddEmbeddedLocalization<Startup>() and then making sure your xml files are marked as embedded in the project file.  I think it will scan for all embdedded xml files but in Foundation we use lang folder.

#294504
Jan 11, 2023 17:53
Kevin Gainey - Jan 11, 2023 18:24
Awesome! Thanks Mark. It was the embedded file setting I was overlooking.
Vote:
 

Glad you got this figured out! Just in case this helps anyone- I recently ran into an issue where Views.en.xml was not embedded, despite the file being marked as an embedded resource. Changing the filename to Views_en.xml fixed that.

#294506
Jan 11, 2023 21:13
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.