nornagon / cdda-guide

The Hitchhiker's Guide to the Cataclysm
https://cdda-guide.nornagon.net
GNU General Public License v3.0
113 stars 26 forks source link

More detail of offline usage of other language. #106

Closed DoiiarX closed 2 years ago

DoiiarX commented 2 years ago

i have noticed at #105 that

At that case,only english version could use, and the web in other language need loading online.

To reproduce this error,the step is below:

step1: visit the website https://nornagon.github.io/cdda-guide/# and there is a button "installable" to install the web as app. image click the web and the app is installed correctly. image

step2: open the app and visit other language to have items json loaded. image

step3: close the app and close my net. reopen the app again. CopyQ TTVcem as you can see, the english web loaded and the subpage of items work well. CopyQ dabtxi but the items of other language couldn't loaded from cache.


it sounds like which app installed is only about the web from https://nornagon.github.io/cdda-guide/#. and the other pages such as https://nornagon.github.io/cdda-guide/?lang=zh_CN is not cached. yeah,not only pages but items json of other language is not allowed to use offline

To further testing,i try to install the app in https://nornagon.github.io/cdda-guide/?lang=zh_CN.But when you visite other language there isn't a button such as "installable" to installed it. image

So,i installed it by seting >>Application>>install this web as app. image

But what i installed is also https://nornagon.github.io/cdda-guide/#

So i also can't solve the problem.

i think if there is a page like https://nornagon.github.io/cdda-guide/zh_CN/#,maybe it could install the web as app in other language to allowed user to use it offline.


What's more, what make me want to get a docker image is that people in our country cann't connect to github drectly. The government build GFW(Stand for the Great Fire Wall of china) to limit ours visit.

So all we need a vpn(such as clash) to connect github.com. Also somebody use project such as https://github.com/521xueweihan/GitHub520 to edit host to avoid GFW. But it not works always.

So...in our country, many people couldn't use cdda-guide. https://tieba.baidu.com/p/7956117527?pn=1 image

in the screenshot the guys said he have spend more than 20min to loading it. image

there is only the programers or young people which known how to use vpn and pay for it could use cdda-guide, and the normal game player couldn't visit.

I am skilled in python not java. So that i want to build a image web but i don't know how to build it. so i asked for a docker image so that i could deploy it simply.

i have build a dockfile by my own but it not works. it will refresh in few seconds and at some times there is nothing. files such as main.ts is not loading correctly .

image

FROM node:latest

WORKDIR /app

RUN apt-get update && apt-get install -y git && \
    git clone https://github.com/nornagon/cdda-guide
RUN cd ./cdda-guide && npm install --legacy-peer-deps && yarn

ENV PORT=3000
EXPOSE $PORT

WORKDIR /app/cdda-guide
CMD [ "yarn", "dev","--host","0.0.0.0"]

thanks for your reading.

nornagon commented 2 years ago

Yeah, we're not properly saving the translations offline. That's a bug and should be fixed.

As from loading from behind the GFW, I don't see how that's possible because all the data is hosted on GitHub behind raw.githubusercontent.com, which I think is blocked?

nornagon commented 2 years ago

I've made a change that should save the translations offline. Let me know if the issue persists.