Add support for phrases in template files. Revamped every template to make them use phrases. Revamped every CSS file to make them use phrases. Tweaked the contributing document. We now use LogError instead of log.Fatal() in a few places to capture more stack traces. Fixed the suffixes on the topic and post count pages, as they were saying views instead of posts / topics. Split the paginator into it's own template. Refactored the theme logic to defer loading the static files to a later stage. Greatly improved the accessibility with a number of ARIA attributes in places where there were none. Removed the edit-topic and page templates. Renamed the panel-adminlogs template to panel_adminlogs. Non-existent phrases used by transpiled templates should now be logged. Fixed a bug where alertbox was plopped down multiple times on one page. The phrase placeholders are more informative now. Added the CurrentLanguagePackName and GetLanguagePackByName API functions. Notices are now shown when you delete, update, or create a forum.
1.5 KiB
We're not accepting contributions right now, although you're welcome to poke me about things. I'd like to put a process together at some point.
Coding Standards
All code must be unit tested where ever possible with the exception of JavaScript which is untestable with our current technologies, tread with caution there.
Use tabs not spaces for indentation.
Golang
Use the standard linter and listen to what it tells you to do.
The route assignments in main.go are legacy code, add new routes to router_gen/routes.go
instead.
Try to use the single responsibility principle where ever possible, with the exception for if doing so will cause a large performance drop. In other words, don't give your interfaces / structs too many responsibilities, keep them simple.
Avoid hand-rolling queries. Use the builders, a ready built statement or a datastore structure instead. Preferably a datastore.
More coming up.
JavaScript
Use semicolons at the end of statements. If you don't, you might wind up breaking a minifier or two.
Always use strict mode.
Don't worry about ES5, we're targetting modern browsers. If we decide to backport code to older browsers, then we'll transpile the files.
To keep consistency with Go code, variables must be camelCase.
JSON
To keep consistency with Go code, map keys must be camelCase.
Phrases
Try to keep the name of the phrase close to the actual phrase in english to make it easier for localisers to reason about which phrase is which.