SFTtech / SFTtech/openage

String resource markup format

Open
#266 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: assets to-discuss
Dominant language
Python
Stars
14.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I stumbled over this comment in the converter source:

# TODO: transform and cleanup the read strings...
# (strip html, insert formatchars/identifiers, ...)

When take a look at the strings, the following format is being used:

  • <Team>
  • <b>Mini-map<b>
  • Create <b> Samurai<b> (<cost>)
  • ..

I see two different "features" in there. The first one is the pseudo-HTML (it's not HTML as no proper closing tags are being used) that's being used for markup. The other thing is placeholders.

My suggestion is the following:

  • Use a markdown subset for markup: *italic*, **bold**, ***bold italic***. Maybe also the underscore variants (although I prefer simplicity).
  • Use a placeholder syntax inspired by Python 3's named .format() syntax: Create **Samurai** ({cost}). I don't think we need formatting syntax like !s or :.2.
  • Convert all uppercase placeholders to lowercase. Convert camelCase (not sure if that even exists) to snake_case.
  • Strip unneeded whitespace

So the examples above would become:

  • {team}
  • **Mini-map**
  • Create **Samurai** ({cost})

An alternative placeholder could be like in the Django template language: {{ placeholder_name }}. That would also leave open the possibility for filters: {{ begin_date|date:"d.m.y H:M" }}

Opinions?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the converter source around the TODO to understand how resource strings are currently transformed and cleaned up. Review the existing pseudo-HTML markup and placeholders, then clarify the proposed syntax and acceptance criteria with maintainers; done would require an agreed format and consistent handling of the existing examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
content, localization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.