How to run locally the gettext status page?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
demario
Posts: 131
Joined: July 3rd, 2019, 1:05 pm

How to run locally the gettext status page?

Post by demario »

I am wondering if the tools to run the gettext status page similar to this page are available in the wesnoth release so they can be run locally.

I have looked around from the utils/ directory but found nothing that rung a bell.
octalot wrote: April 26th, 2022, 11:17 am It's in a separate repo, https://github.com/wesnoth/website
Much thanks.

I assume we need at least:
  • A tool to generate the static data from the po files in that release (I am going to assume the output is in flat files not stored in database)

    So it can be installed locally by doing something like git clone https://github.com/wesnoth/website.git wesnoth-website.git.
    The different instances of wesnoth we want to generate stats for should be available locally (sourceforge download or git checkout).
    We just need to modify the content of includes/config.php under the local directorygettext.wesnoth.org/ and modify the settings (esp. branch = '...', master_basedir = '...', branch_basedir = '...') based on the local copies.

    Then run php ./bin/grab-stats.php from the same directory to generate the static data for the server.
    Mind that it will create a lock file under /tmp/grab-stats.lock that you will have to delete by hand if you interrupt with CTRL+C.
  • A web server configuration
    You just need to run the default server provided by php (php5 -S localhost:8080) from the directory gettext.wesnoth.org/. It will be configured using the index.php on that directory.
  • A set of templates for web pages to render that data
    It seems the templates are retrieved directly from wesnoth.org/wesmere, so on one hand, they don't need to be installed and on the other hand the local server still needs direct access to the resources on line.
Last edited by demario on May 6th, 2022, 9:04 am, edited 2 times in total.
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: How to run locally the gettext status page?

Post by octalot »

It's in a separate repo, https://github.com/wesnoth/website

The stats themselves are calculated by running msgfmt -o /dev/null --statistics
https://github.com/wesnoth/website/blob ... ns.php#L91

There's some mentions of WesCamp in the code, but those aren't used - it was a project for translating UMCs but is no longer running.
Post Reply