Docusaurus locale Fr always falls back to English in new projects - docusaurus

I am fairly new to Docusaurus. I created my first documentation site in May 2022 with Docusaurus v2 and with a bit of trial and error (getting folder name and filenames exact etc) I managed to get it working in English and French and with versioning. During this process Docusaurus 2 upgraded several times.
Now I am trying to make two other sites and in both cases they always fall back to English when I run the locale Fr (npm run start -- --locale fr).
I have checked folder names and filenames and they all match. As a test I copied some files from the third site to the first site and they work as expected. The only way I can get French in the two new sites is to put them in the docs (English) folder. This is not ideal but is a workaround.
I am wondering if it is a bug when starting from the newer updates? However, no-one else seems to have written in with similar problems. So it may be something I am doing but I just can't see what I am doing wrong. The site I originally created has upgraded to the newest and continues to work, it is just the newer sites that were created with the updates that aren't working.
Has anyone else seen this? Any help would be much appreciated. Thanks.
Edit:
As I said, I am new to Docusaurus, so the problem was my misunderstanding of the file structure. My first working site had versioning as well two locales, so the files were correctly in a current folder. My next sites didn't have versioning so I didn't have the French in a current folder. Once the files were moved the problem was solved.
If you look carefully at the diagram (https://docusaurus.io/docs/api/plugins/#docusaurus/plugin-content-docs#i18n) it does say to put translated files in a current folder, and then it has versions folder directly below.
Whereas the English is very different. It doesn't have current and has the version files in a very separate folder.
Thanks to Joshua for his help.

Related

How to add GET parameter to CSS filename in plugin JCH Optimize (Joomla)

I cannot find an answer to for several weeks. Perhaps my experience in development is not so great :) One site uses the JCH Optimize plugin and I noticed that after clearing the old memory (caches), the CSS and JS file links do not change, i.e. the names of these files remain old. The problem is that the browser checks the file name and if it has not changed, then the site visitors show the old version of the style file. The question itself, where in the plugin (in which code file) i can add some GET parameters ?vers = 1.1 so that for the browser it is a new file and it would update the information for users. I will be glad to hear any solutions. Thanks.
The names of the combined css and javascript files are keyed from the names of the individual files on the page. Clearing the cache will not cause the plugin to generate a different file name.
As of version 7.0.0, there is an option to generate a different cache key if you want to change the names of the combined file. Update your current version to get that capability.

WIX: Files not copied over on new installs

So, I have a WIX project which is to install either fresh installations or over previous installations of a product. This product, if it was already installed, has several files inside of 3 different folders which need to be preserved. This project also needs to copy the contents of those 3 different folders into another set of folders (same content in two different locations). In order to accomplish this I have set up my project to first attempt to write into the original folders if the files don't already exist, then copy the contents of those folders. On an upgrade where those files already exist this works fine. On a fresh install the second set of folders do not get created, but all the files do.
My assumption, and I may be incorrect, is that the msi is attempting to copy the folders over before they have even been created. This would cause folders to not exist in the area they were supposed to be copied to as there would be nothing to copy from. Is there a way I can ensure the files have been generated before trying to copy them? Is there a better way of going about this that I'm not seeing?
EDIT:
I'm going to try to clear this up a little. What I'm trying to do is the following (pseudo):
1) See if an option file (hi.opt) exists in c:\options, if not create it.
2) Copy that file to c:\options\opt2015.
I'm doing this 3 times for 3 different folders. I am creating the initial files with Wix in the c:\options folder using the NeverOverwrite parameter. This part works great; the files are created without issue and none are overwritten if they already exist. Where the problem lies is step two where I'm using the CopyFile Wix command. This will only copy some of the files from the c:\options folder to the c:\options\opt2015 folder. Depending on the initial setup of the system (if the files at c:\options exist or not) some files will copy over and others won't. It's not random, the results are repeatable every time, but there seems to be no reason why some files copy and others don't depending on the initial setup of the system.
I hope this makes sense and is a little more clear, though I think it makes things worse! It is strange behavior because to me it looks like everything should just work, but it doesn't (isn't that every bug though).
Edit2:
After more work and creating a vb script which runs perfectly outside of WIX my team and I have determined that the files just are not being seen by WIX during the installation even though they do exist. We haven't found any permissions issues and the installation is running as admin on an admin account. Doing the copy via a VBS or through the Wix CopyFile command results in, well the same results; files that already exist on the system are not being copied. Any more ideas? Should we find a solution I'll be sure to post it because this is just getting weird.
I believe your installer design should work as long as you're attempting to copy the files after the InstallFiles action runs. You should be copying the files from the first set of folders to the second set of folders by doing one of the following:
Running a deferred custom action that executes after InstallFiles
Using the MoveFiles action
This is too long for a comment, but may not be an answer either....
There isn't really such a thing as "over previous installations of a product", especially if you end up with multiple instances in Programs/Features, and files that may or may not have the same component ids replacing each other - that's going to be a mess. If you need to upgrade the installed product, use a major upgrade, that seems to be where you're going with this. If you are already writing custom actions to do some of this "first attempt to write into the original folders" then I've no idea what's going on or where you doing this in the install. In general, if you need those files in the new install then add them to the new major upgrade MSI. If you need to copy the older existing files from the older product, then do a major upgrade with afterInstallExecute and write custom action code to copy them before the InstallFiles action. Or the CopyFile WiX element could do it, see the part about the element under a component with no fileid.
http://wixtoolset.org/documentation/manual/v3/xsd/wix/copyfile.html
Well, as sometimes happens, the error was entirely elsewhere. It turns out that an uninstaller for another program which was in the chain of programs which are installed at the same time was destroying the folder. Unfortunately this is what happens when a product isn't touched for 10 years. Thank you for your contributions, they were very helpful. Even though I was going down the wrong path the whole time I still made use of them in my tests and am more adamant about checking the installation order.

site moved to a new server and now pdfs wont download

I had a joomla 1.5 site for a couple of years on a linux cpanel - everything was running fine. Last week we moved it to a new linux server and now we have a strange problem. The general navigation etc works fine but linking to pdfs seems to have gone "Random". For example there are 4 pdf links on this page http://www.coinstreet.org/spacehire/conferencemeetings.html - they all have different links. However, for 3 of them the same pdf is downloaded (despite the different links) and one doesn't work at all - get a 406 error.
The new install was taken by doing a straight backup of the cpanel and then a re-install. All other functionality seems to be fine.
I am at a bit of a loss - so any suggestions would be gratefully received!
PS Just noticed that I see a lot of lines like this in the error logs
[Sat Mar 31 14:50:10 2012] [error] [client 65.92.86.225] File does not exist: /data03/c9566644/public_html/406.shtml, referer: http://www.coinstreet.org/images/stories/coinstreet/JDPS%20Childcare%20Assistant.pdf
don't know if that's relevant?
UPDATE
I created a test link to fred.pdf that DIDN'T exist on the server. WHen the link is clicked rather than giving an error as expected a pdf was downloaded. TUrns out that several pdfs are missing it seems and that this same file is downloaded. When I put a fred.pdf on the server then the test link worked as expected. So, where is this "Wrong" pdf coming from...
ANother update
I have now discovered that the same problem was happening on the old server... too oh boy!
Also, the mystery pdf that downloads is actually part of one of the articles on the site, turned into a pdf on the fly. If I unpublish that article then I get just a blank pdf appear. Time to look closely at the .htaccess file me thinks... anyone else got any thoughts?
I believe you have the filename typed in wrongly!
The link you have on your site:
http://www.coinstreet.org/images/stories/coinstreet/Meeting%20Space%20User%20Special%20Requirements%20Policy3.pdf
The link I used to see the PDF successfully:
http://www.coinstreet.org/images/stories/coinstreet/Meeting%20Space%20User%20Special%20Requirements%20Policy(3).pdf
Notice the ( ) around the 3
I think you are seeing the results of two different effects here:
a) Some form of incorrect encoding when the files were uploaded - clearly the spaces and extended characters in the file name are being url encoded prior to saving. I've seen ftp programs do this and I've also seen Joomla do this periodically. I don't know if cPanel backups don't sometimes do this too. Best advice I can give is to always rename files to remove spaces(swapping for hyphens) as well as stripping brackets, ampersands and exclamation marks (bangs). Train users to do likewise to avoid these issues - and check error logs periodically to pick up on anything you miss or that changes.
b) Now with your requests for the files not matching the actual filename you would expect to see 404 errors - but sometimes you get a file, not always the right one though. My guess here is that you have the apache module that attempts to match files based on misspellings - sorry can't recall the exact name off hand. A quick search shows mod_speling (mis-spelling of spelling is deliberate) is the most likely contender.

Trying to perform a diff using netbeans and its Git repository

I have two different version of a website, an older version, and a newer version that is supposed to have some sort of virus on it (or malicious code of some kind). I need to perform a diff between the two sites and try to eliminate the virus in the newer one.
After some searching I found netbeans 7.1 is able to do this using it's Git Repository. I was following this tutorial http://netbeans.org/kb/docs/ide/git.html but I am not getting the same options on my screen as in the tutorial. I am using netbeans 7.1 RC1 and downloaded the jdk from the link on that same page. The jdk download itself says jdk7 but the folder it creates on my computer is named jdk1.7.0_01 . I'm assuming jdk7 is short for jdk1.7 .
I get as far as the very end of the "Initializing a Git Repository" step. The end when it says "All the project files are marked Added in your Working Tree. To view a file status, place the cursor over the file name in the Projects window. The status of the file in the Working Tree displays in green to the right of the slash like shown in the following picture." does not happen.
I tried going further anyway, but there is just more and more options that do not show up for me.
I am also open to another way to perform a diff operation between the sites, it doesn't have to be with using netbeans. I should note however I do not have access to a unix box. So the solution has to work for windows, or I guess I can go on a coworkers mac if I need to.
Thank you.
From your question, it sounds like you did not already have your web site code under version control. If that's the case then I'd suggest doing so, and git is a very good choice. It is what I use.
Your goal, however, is to diff the older version of your site with the "newer" (possibly infected) version, and that can be done without having to deal with a version control system. There are several good diff tools for Windows. I mainly use WinMerge, as I like its user interface and simplicity. KDiff3 is another good one, and I use that one in conjunction with git merge operations, because it supports a three-way-merge comparison (which WinMerge does not).
If you were to use WinMerge for your diff, and you had the code from the old version in Q:\example.com\old-version and the "new" version in Q:\example.com\current-version, then you would start WinMerge, and either choose File|Open... from the menu, or click on the open icon in the toolbar. You would get a dialog like the following, and would fill it in as shown:
If you filled everything in correctly, then you would be able to click on the OK button, and would get a list of file differences. Depending on the default settings, you might also see files that have not changed at all in that list. You can hide those using the View menu. Double-clicking on a file with differences will open the two versions and show you the differences.
Explore the WinMerge options. I have mine set, for example, to compare white-space differences, but to ignore different line endings (Unix's LF versus Windows' CR/LF).

How to compare test website and live website

We have our production server running our website. Then we have a test server which has exact same data but with changes to code to do some new functionality. This web app has over 500 pages.
Is there any program that can
Login to the test site
Crawl through each page and then save the page as html
Compare with the same page saved with live site?
This way we can make sure that new features that we add to our test site will not break the live site when code updates are applied to production.
I am currently trying to use WinHTTrack website copier and then comparing the test and live folders with some code comparison tool like beyond compare. This works ok but there are lot of files changed because of the domain name changes.
Looking forward to ideas / solutions for this problem.
Regards
Have you looked at using Watir for this? It's not exactly the thing you are looking for but it might allow you some more granularity in your tests and ensure the site is functionally identical rather than getting caught up on changing guids, timestamps and all the other things that tend to change across any significant size website from day to day as part of it's standard functionality.
Apparently you can't make consistent, reproduceable builds in your project, can you? I would recommend moving towards that in the long run, it will save you a lot of headaches. That way you would know exactly what was deployed to which server when, so there would be no more need to bend around backwards to get the deployed sources back like this...
I know this is not a direct solution to your problem... but maybe it is worth comparing, whether you would save more in the long run by investing the efforts into your build process now, instead of implementing this workaround (and then improving your build process anyway - because one day you will almost surely need to do that).
wget has a --convert-links option, there are also some options to preserve cookies that might let you do it logged in http://drupal.org/node/118759#comment-664498
use an Offline Downloader, download all files to your computer from both sources, then compare the folder contents using a free tool like Total Commander.
EDIT
Load both of your sources into a CVS, and compare it there.