Internationalization automation of HTML character sheets made for Roll20
ACSI is a simple program to partially automate the internationalization of existing Character Sheets made for the Roll20 platform. It takes a html file, creates a copy where it places i18n
-tags according to some of the Character Sheet i18n standard. Works on Linux.
/linux/
folder.git
installed you can just run the command git clone https://github.com/Anduh/acsi.git
and it downloads everything)
acsi
folder and run make
command. ACSI should compile now from the files in the /src
folder into a new program file simply named acsi
. (This is not a complete install, only create a local program that can be run inside the folder)If it throws errors such as missing file stdio.h
or similar, you might need to also install the build-essential
package.
List of operating systems that ACSI have been successfully installed/compiled on.
Linux:
build-essential
package)If you installed ACSI with Optinon 1, you can now call ACSI from the command line with: acsi <filename>
, where you replace <filename>
with the name of your file you want translated(must be a .html
file). Your command line terminal need to be open in the location where your file is located.
If you only compiled ACSI with Option 2, you must place the html file you want translated in the same folder as ACSI is located. You can now call ACSI from the command line with: ./acsi <filename>
.
NOTE: In V0.5, rolltemplates
and sheetworkers
should be removed from the HMTL so ACSI won’t trip and make changes to them.
ACSI will read the html file it is given and create a html file(named <originalname>-i18n.html
) where it have inserted the i18n
-tags in the proper places, without touching the original file, and optionally also the .json
translation file, so it doesn’t have to be done with a broswer’s developer console.
If everything worked out as it should, it should display a short <filename>-i18n.html created!
on the command line. A simple testfile can be found here.
At it’s current state, ACSI can only create i18n
-tags for standard text, that doesn’t contain many line-breaks or special characters. If a sheet contains lots of commented HTML code, ACSI might be thrown off and produce an unusable result. ACSI is also assumed to be used on a sheet containing no i18n-tags or HTML error, as it isn’t yet capable of noticing existing tags nor does it check the validity of HTML syntax.
ACSI is written in C, and relies on a few Unix commands, so it needs to be run in a Linux enviroment to work(Project author uses Ubuntu 16.4 TLS/Linux Mint 19.1). Doesn’t rely on any advanced libraries.
If you run ./acsi <filename> t
, ACSI will additionally print in the console the generated tagnames and their contentents.
If you run ./acsi <filename> j
, ACSI will generate the translation file with the name <originalname>.json
.
If you run ./acsi <filename> a
, it will do both options mentioned above.
savetxt()
function in some unusual linebreaks and unexpected charactersrolltemplate
and script
sections. It’s better to remove those sections from the code before running ACSI than working with the somewhat unreliable V0.32i18n
-tags<p>like this text</p>
The primary focus of the project is to prioritize on implementing the largest timesavers when it comes to creating i18n
-tags, and in the end to automate as much as possible of the process. As a secondary goal it serves to improve programming/coding/documentation habits of the participants.
ASCI has a “two birds, one stone” origin from a ‘C/Unix’-programming course, which explains the not too optimal choice of C for a text-parsing program.
If the interest arise, ACSI could be adapted/rewritten with other libraries/modules/languages for ease of further development, or just portability but it’s of lower priority.
The aim for the Alpha version is to have ACSI reliably create 70% of the i18n-tags for any given sheet, and not to get thrown off by to many stray html comments or special characters in unexpected places.
cs>
, cs<
, cf>
, cf<
found in some rolls (credits to David for noticing)<script>
, <rolltemplate>
and <charmancer>
sections(sheetworkers) without altering themV.1.0 aims to reliably create 90% of i18n-tags for any given sheet, and provide more automation options, such as generating the associated translation.json
file.
title
, label
and placeholder
translation.json
by itself (replicating the browser’s console.log() method)~ Implemented in V0.5translation.json
file back to the sheet(so it will be easier to change the autogenerated tags)Optional things that could be done which goes beyond the primary goal if ACSI but could be useful or be a good learning experience to implement
unistd.h
and sys/.h
libraries), creating Windows/Mac version<input>
,<textarea>
fields are named with attr_
prefixes, warn not to use id
-attributes and other known Roll20-specific constrainstranslation.json
. Represented on the html sheet with the data-i18n
global attributetranslation.json
needed to show a character sheet in Roll20<script>
tags (Roll20Wiki page)