Custom translations with Theme System not work #2264

Closed
opened 2026-02-05 03:29:36 +03:00 by OVERLORD · 17 comments
Owner

Originally created by @daoxiaoyue2012 on GitHub (May 25, 2021).

Following the relevant instructions in the document (Hacking BookStack), I changed some text content, for example: 'search' changed to 'find', but it did not take effect. The 'search' word is still displayed on the page. The'APP_THEME' option has also been added to the environment file. Can anyone help me see what the problem is? thank you very much.

Originally created by @daoxiaoyue2012 on GitHub (May 25, 2021). Following the relevant instructions in the document [(Hacking BookStack),](https://www.bookstackapp.com/docs/admin/hacking-bookstack/) I changed some text content, for example: 'search' changed to 'find', but it did not take effect. The 'search' word is still displayed on the page. The'APP_THEME' option has also been added to the environment file. Can anyone help me see what the problem is? thank you very much.
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

Hi @daoxiaoyue2012,
Can you provide details of how you've used the theme system? The files you've created and the content within them, and the APP_THEME value you've set?

@ssddanbrown commented on GitHub (May 26, 2021): Hi @daoxiaoyue2012, Can you provide details of how you've used the theme system? The files you've created and the content within them, and the `APP_THEME` value you've set?
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

Thank so much for your reply. The following is the corresponding section in the .env file.

image

I created the corresponding folders in the themes folder, and the details are as follows.

image

In the common.php file, I changed 'Search' to 'Find', and the following is the content of the file.

image

After completing the above process and reloading the page, The 'search' word is still displayed in the search box.

image

@daoxiaoyue2012 commented on GitHub (May 26, 2021): Thank so much for your reply. The following is the corresponding section in the .env file. ![image](https://user-images.githubusercontent.com/12840932/119684141-d4c48780-be76-11eb-91ab-8ecdea69b30b.png) I created the corresponding folders in the themes folder, and the details are as follows. ![image](https://user-images.githubusercontent.com/12840932/119681733-e9078500-be74-11eb-805d-ad7da658ccfc.png) In the common.php file, I changed 'Search' to 'Find', and the following is the content of the file. ![image](https://user-images.githubusercontent.com/12840932/119682078-2c61f380-be75-11eb-8981-708be2bbe1d8.png) After completing the above process and reloading the page, The 'search' word is still displayed in the search box. ![image](https://user-images.githubusercontent.com/12840932/119683884-a181f880-be76-11eb-9485-f0be0a608e19.png)
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

@daoxiaoyue2012 Odd, Seems to work for me using the same setup.
Do you happen to have a bootstrap/cache/config.php file within your BookStack directory?

@ssddanbrown commented on GitHub (May 26, 2021): @daoxiaoyue2012 Odd, Seems to work for me using the same setup. Do you happen to have a `bootstrap/cache/config.php` file within your BookStack directory?
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

There is no config.php file in the directory, and only two files: packages.php and services.php.

@daoxiaoyue2012 commented on GitHub (May 26, 2021): There is no config.php file in the directory, and only two files: packages.php and services.php.
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

@daoxiaoyue2012 Thanks for confirming. Can you provide any details regarding how you're running BookStack? Are you using something like docker?

@ssddanbrown commented on GitHub (May 26, 2021): @daoxiaoyue2012 Thanks for confirming. Can you provide any details regarding how you're running BookStack? Are you using something like docker?
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

Docker is not used here. CentOS(v7.9) is running on my server, and nginx(v1.14) with php-fpm is used. During the installation, I referred to related guide(Installation).

My site's address is pets.friendmorning.com.

@daoxiaoyue2012 commented on GitHub (May 26, 2021): Docker is not used here. CentOS(v7.9) is running on my server, and nginx(v1.14) with php-fpm is used. During the installation, I referred to related guide([Installation](https://www.bookstackapp.com/docs/admin/installation/)). My site's address is [pets.friendmorning.com](http://pets.friendmorning.com).
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

Okay, That's odd, All looks fine.

Can I confirm the location of thethemes folder? Is it within your BookStack folder? If you run ls -a within the folder do you see a .gitignore file?

@ssddanbrown commented on GitHub (May 26, 2021): Okay, That's odd, All looks fine. Can I confirm the location of the`themes` folder? Is it within your BookStack folder? If you run `ls -a` within the folder do you see a `.gitignore` file?
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

I am so sorry for the delay in my reply, and my English is not good.

image

@daoxiaoyue2012 commented on GitHub (May 26, 2021): I am so sorry for the delay in my reply, and my English is not good. ![image](https://user-images.githubusercontent.com/12840932/119697474-cb411c80-be82-11eb-8f90-b7f1e1201ce8.png)
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

@daoxiaoyue2012 From that same directory, could you run ls -al themes/ and provide the output?

@ssddanbrown commented on GitHub (May 26, 2021): @daoxiaoyue2012 From that same directory, could you run `ls -al themes/` and provide the output?
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

image

@daoxiaoyue2012 commented on GitHub (May 26, 2021): ![image](https://user-images.githubusercontent.com/12840932/119698040-6c2fd780-be83-11eb-944c-1f8d94e2a3d9.png)
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

That looks okay, Now, To be sure of the file itself, the same again but ls -al themes/custom/lang/en

@ssddanbrown commented on GitHub (May 26, 2021): That looks okay, Now, To be sure of the file itself, the same again but `ls -al themes/custom/lang/en`
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

image

@daoxiaoyue2012 commented on GitHub (May 26, 2021): ![image](https://user-images.githubusercontent.com/12840932/119699891-35f35780-be85-11eb-9b66-dad6d1511416.png)
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

Permissions and paths all look okay. I'm not really sure what further to suggest to be honest. Have you made any other customizations or alterations to core app files? Or have you set any other options or changes relating to languages?

@ssddanbrown commented on GitHub (May 26, 2021): Permissions and paths all look okay. I'm not really sure what further to suggest to be honest. Have you made any other customizations or alterations to core app files? Or have you set any other options or changes relating to languages?
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

@ssddanbrown I have not modified the core file. Initially I tried to modify the common.php file under resource/lang/en folder to complete it, but it didn't work. Later, I found that this was mentioned in the document, and it can be done by hacking. So I tried this method.

@daoxiaoyue2012 commented on GitHub (May 26, 2021): @ssddanbrown I have not modified the core file. Initially I tried to modify the common.php file under resource/lang/en folder to complete it, but it didn't work. Later, I found that this was mentioned in the document, and it can be done by hacking. So I tried this method.
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

@ssddanbrown Sorry, I found the problem. It was my mistake. There are two directories, which correspond to different domain names: friendmorning.com and pets.friendmorning.com. I did not operate in the corresponding directories.

@daoxiaoyue2012 commented on GitHub (May 26, 2021): @ssddanbrown Sorry, I found the problem. It was my mistake. There are two directories, which correspond to different domain names: friendmorning.com and pets.friendmorning.com. I did not operate in the corresponding directories.
Author
Owner

@daoxiaoyue2012 commented on GitHub (May 26, 2021):

@ssddanbrown I'm so sorry for taking you so much time. Thank you so much for spending so much time helping me find the problem.

@daoxiaoyue2012 commented on GitHub (May 26, 2021): @ssddanbrown I'm so sorry for taking you so much time. Thank you so much for spending so much time helping me find the problem.
Author
Owner

@ssddanbrown commented on GitHub (May 26, 2021):

@daoxiaoyue2012 Ah, That'll do it. No worries, Happy to hear you found the solution!

@ssddanbrown commented on GitHub (May 26, 2021): @daoxiaoyue2012 Ah, That'll do it. No worries, Happy to hear you found the solution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2264