typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
427 stars 60 forks source link

Translations don't work #245

Closed michelangeli-dev closed 3 years ago

michelangeli-dev commented 3 years ago

Hello

My site is hosted at an address like: https://mydomain.com/mysite. But my site is accessible at: https://mysite.eu

If I configure and use Typemill with the address "https://mydomain.com/mysite", Typemill is automatically in French. Very good.

If I configure and use Typemill with the address "https://mysite.eu", Typemill remains in English (no translations work).

Can you help me ? Thank you.

trendschau commented 3 years ago

hard to say, I suppose it depends on how you configured the site, maybe you have some details? Do you use a proxy for that?

I assign it to @iusvar because he is more into the details how the translation part works :)

ghost commented 3 years ago

I'm sorry but I didn't understand what the two different addresses are and obviously I can't test this situation ...

michelangeli-dev commented 3 years ago

Hello Thank you for your answers and sorry if I was not clear enough in my request.

My blog is accessible through the address https://myblogname.eu But in fact, this domain name (myblogname.eu) points to a subfolder of my WEB hosting (shared WEB Hosting) in which the files are located (ie www/typemill)

This same subfolder (ie www/typemill) is also accessible by the address «https://mysitename.webhost.com/typemill/»

If I configure and use (for example : admin page) Typemill with the address "https://mysitename.webhost.com/typemill/", Typemill is automatically in French. Very good.

If I configure and use (for example : admin page) Typemill with the address "https://myblogname.eu", Typemill remains in English (no translations work).

I hope I have been clearer this time.

Thank you for your work and I will immediately support it with a donation.

ghost commented 3 years ago

Thanks for your more detailed answer. I too will have to go into more detail on my previous answer.

I understand your configuration but I am unable to recreate it in order to test a suitable solution. I work exclusively locally for my needs (in fact I don't have any website) so I don't know how to proceed.

I'm sorry for you and for @trendschau too.

trendschau commented 3 years ago

Thank you @iusvar, and thank you @michelangeli-dev for the donation!

I run several websites with Typemill but I never faced a problem like this. I also checked the code and I don't see anything suspicious here. So it's not possible for me to reproduce and fix the error right now.

Maybe you can activate the error reporting in you installation (under settings -> developers) and then check (e.g. in your error logfiles) if you see anything? Maybe the system cannot load the translation files for some reasons, but again, it is not possible to analyze an error without reproducing it.

At the end it might help to contact the hoster and ask for advice?

michelangeli-dev commented 3 years ago

I'll activate the error report and look for clues. I also thought that the system with the address rewrite no longer found the translation file. So I looked at the codes, but my skills are not enough. I'm having trouble figuring out the encoding of a yaml file!

@trendschau, and @iusvar : Thank you for your help and your CMS.

michelangeli-dev commented 3 years ago

I was able to enable site translation by creating an fr.yaml file in the theme's "languages => user" folder. The translation therefore seems to work except for the administrator part of the site.

Do you want my "fr.yaml" file to be included in a future Typemill update?

michelangeli-dev commented 3 years ago

I have identified the problem and the translation files are loaded now.

When calling the translation in the "system.php" file, "tm" or "setup" corresponds for me to "$ pieces [1]" and not to "$ pieces [0]".

I think as the domain name "myblogname.eu" points to the folder "www / typemill" when the function "$ uri-> getPath ())" returns the path, "tm" or "setup" is not the root.

I'm not sure if I'm using the right terms. But, the "page management" and "admin" parts are now translated.

You can close the discussion !!

Thank you for taking your time to help me.

michelangeli-dev commented 3 years ago

PS: my "fr.yaml" file is available on my Github page

trendschau commented 3 years ago

Hi @michelangeli-dev great that you found a solution and thank you for describing the solution to us! Also thank you for the translation file, we will check it on your Github page :)