Abstract out repetitive localization code #6727
Labels
C: website
P: default
Priority: default. Default priority for new issues, to be replaced given sufficient information.
T: enhancement
Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.
The problem you're addressing (if any)
There's a repetitive code pattern in the new localization code (website repo). Here's a grep of the first line of it:
As you can see, this pattern gets repeated a lot, and the whole thing is usually around 10 lines long.
The subsequent lines usually follow a similar pattern to each other but are not exactly the same each time, so it isn't a simple matter of deduplication.
Describe the solution you'd like
@maiska, would you mind taking a look to see if there's a way to abstract this out into an
include
so that it's not repeated so many times?Where is the value to a user, and who might that user be?
Code duplication makes things more difficult for website contributors and maintainers. By practicing DRY, we make it easier for people to collaborate on the website codebase.
Describe alternatives you've considered
None.
Additional context
Discovered while refactoring and cleaning up the website code (QubesOS/qubesos.github.io@72f41a0 and surrounding commits).
Relevant documentation you've consulted
Newly-added section, based on recent refactoring and cleanup experience:
https://www.qubes-os.org/doc/doc-guidelines/#coding-conventions
Related, non-duplicate issues
None found.
The text was updated successfully, but these errors were encountered: