Add 'samples' folder with new updated config-sample.txt and more - #1426
Open
nerun wants to merge 1 commit into
Open
Add 'samples' folder with new updated config-sample.txt and more#1426nerun wants to merge 1 commit into
nerun wants to merge 1 commit into
Conversation
README), plus scripts to automatically read tinyfilemanager.php, extract translation strings and update translation.json with new strings, remove old strings don't used anymore, but keep translations of existing strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 'samples' folder with new updated config-sample.txt (link updated in README), plus scripts to automatically read tinyfilemanager.php, extract translation strings and update translation.json with new strings, remove old strings don't used anymore, but keep translations of existing strings.
Description
Config sample
The default file at https://tinyfilemanager.github.io/config-sample.txt is outdated, incomplete, and inaccessible to everyone. By creating a sample folder, we can easily update it.
The new
config-sample.txtfile is compliant and compatible with PR #1421, which fixes some issues related to saving to the file, but it has not yet been merged.The new file includes new settings added by PR #1276 (merged), as well as:
$CONFIGthat was always missing.$global_readonlyand$upload_chunk_size_bytes, which already existed but were not included in the currently existingconfig-sample.txt.Diff:
Caution
There's one thing to consider: the
$CONFIGin this version of the sample is not located directly below the<?phptag, where the currentsave()function expects it to be. The new sample was designed with PR #1421 (not merged yet) in mind.Scripts for
translation.jsonupdateThere are two scripts inside
samples/:generate_translation-sample.pysync_translations.pygenerate_translation-sample.py
Generate
translation-sample.txtfromtinyfilemanager.php.It searches for all
$tr['en']entries and transforms them into JSON in the format expected bytranslation.json.Usage:
python generate_translation-sample.py
sync_translations.py
Synchronizes
translation.jsonwithtranslation-sample.txt.Features:
--checkmode (verify only):python sync_translations.py --check
Normal usage:
python sync_translations.py
Warning
I could have used these scripts to create the new, updated
translation.jsonfile, but I didn't. There are several translations in the Pull Request pipeline, and that could cause confusion later. But I assure you that the scripts work fine. I also considered that updatingtranslation.jsonusing Python scripts provided by this PR should be done by the development team, not by a random contributor.