martijnboland / apptext

AppText is a content management system for applications. Application developers can use it to replace static resources in applications with dynamic content and delegate content management to non-developers.
https://apptext.io
Apache License 2.0
23 stars 5 forks source link

How to replace default languages in header #43

Closed vallieresc closed 1 year ago

vallieresc commented 3 years ago

I always see EN and NL languages in the header language selector even after initializing the app with EN and FR languages

martijnboland commented 3 years ago

The languages in the header selector of the admin app are defined in the apptext_admin app. Initializing the app with languages affects your own app, not the admin app. If you want to change the languages for the admin app, you can do that by selecting the admin app first (top-left) and then edit the app to add/remove languages for the admin app.

vallieresc commented 3 years ago

Got it! I believe the default should probably be English only as most will use this language and it is for the admin app only. After removing NL, I saw that there was a bug with the dropdown menu in the client app. It is still showing even though there is only 1 language. I can send you a pull request for that.

martijnboland commented 3 years ago

A PR would be great, thanks :-). I'm not sure if only English as default language is a good idea, because the admin app itself is such a nice example of how you can use AppText.

vallieresc commented 3 years ago

I got something started, I'll try and complete it and test it. For us, our admin is English only and the public app is multilingual. I would think that most would have this setup. As an example WordPress admin is in your selected language, only the public UI is multilingual.

vallieresc commented 3 years ago

@martijnboland The admin views seem to be missing from the AppText.AdminApp project. The views folder has an X on it. Am I missing something? Here's the exception: InvalidOperationException: The view 'AppTextAdmin' was not found. The following locations were searched: /Views/Admin/AppTextAdmin.en.cshtml /Views/Admin/AppTextAdmin.cshtml /Views/Shared/AppTextAdmin.en.cshtml /Views/Shared/AppTextAdmin.cshtml /Pages/Shared/AppTextAdmin.en.cshtml /Pages/Shared/AppTextAdmin.cshtml

martijnboland commented 3 years ago

Ah yes, that's a bit tricky: the AppTextAdmin view is created by the client-side build. This build takes the AppTextAdminTemplate view from the ClientApp/Templates folder and inject the proper script references and the copies the completed view to the final destination. So the solution is to run 'npm install' followed by 'npm run build' in the ClientApp folder of the Apptext.AdminApp project. More info can be found here.