DEV Community

Cover image for How I Translated 277 Strings in 5 Minutes (Real-World Case Study)
Nikolaos Protopapas
Nikolaos Protopapas

Posted on

How I Translated 277 Strings in 5 Minutes (Real-World Case Study)

The Challenge

ShareX is an amazing open-source screen capture tool with 35K+ GitHub stars. It supports 24 languages with 170 translatable strings.

I wanted to:

  • Add Greek as a new language
  • Complete Spanish translations
  • Find any unused localization keys

And I wanted to do it for free - no paid translation APIs.

The Tool: LRM

LRM (Localization Resource Manager) is an open-source CLI tool I built for managing localization files. It supports:

  • .resx (ShareX uses this), JSON, i18next, Android, iOS, PO, XLIFF
  • Free translation providers: MyMemory, Lingva, LibreTranslate
  • Local LLMs: Ollama (Llama, Mistral, etc.)
  • Paid providers: DeepL, Google, Azure, OpenAI, Claude (if you need them)

Step 1: Check Current Status

cd ~/ShareX/ShareX/Properties
lrm stats
Enter fullscreen mode Exit fullscreen mode
┌─────────────────────────────────────────────────────────────────┐
│                     Localization Statistics                     │
├──────────┬──────┬────────────┬───────┬─────────┬─────────┬──────┤
│ Language │ Keys │ Translated │ Empty │ Missing │ Coverage│ Size │
├──────────┼──────┼────────────┼───────┼─────────┼─────────┼──────┤
│ default  │  170 │        170 │     0 │       0 │  100.0% │ 48KB │
│ de       │  163 │        163 │     0 │       7 │   95.9% │ 47KB │
│ es       │   63 │         63 │     0 │     107 │   37.1% │ 20KB │
│ fr       │  170 │        170 │     0 │       0 │  100.0% │ 50KB │
│ ...      │      │            │       │         │         │      │
└──────────┴──────┴────────────┴───────┴─────────┴─────────┴──────┘
Enter fullscreen mode Exit fullscreen mode

Spanish at 37%? Let's fix that.

Step 2: Add Greek (New Language)

lrm add-language el
Enter fullscreen mode Exit fullscreen mode
✓ Created: Resources.el.resx
  Keys: 170 (copied from default)
  All values empty - ready for translation
Enter fullscreen mode Exit fullscreen mode

Step 3: Translate with Free Providers

Option A: MyMemory (Free, No API Key)

# Translate Greek (all strings)
lrm translate "*" --provider mymemory --from en --to el

# Complete Spanish (only missing)
lrm translate "*" --provider mymemory --from en --to es --only-missing
Enter fullscreen mode Exit fullscreen mode

Option B: Lingva (Free Google Translate Proxy)

lrm translate "*" --provider lingva --from en --to el
Enter fullscreen mode Exit fullscreen mode

Option C: Local Ollama (100% Offline)

If you have Ollama running locally:

# Use Llama 3.2 or any model you have
lrm translate "*" --provider ollama --from en --to el
Enter fullscreen mode Exit fullscreen mode

Configure the model in lrm.json:

{
  "Translation": {
    "AIProviders": {
      "Ollama": {
        "Model": "llama3.2",
        "ApiUrl": "http://localhost:11434"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Step 4: Validate

lrm validate
Enter fullscreen mode Exit fullscreen mode
✓ Validation passed
  Files: 25
  Issues: 0
  Placeholder mismatches: 0
Enter fullscreen mode Exit fullscreen mode

LRM automatically checks that {0}, {1} placeholders are preserved.

Step 5: Find Unused Keys

lrm scan --show-unused
Enter fullscreen mode Exit fullscreen mode
Code Scan Results
─────────────────
Source files scanned: 847
Localization keys: 170

Unused Keys (5):
  • HotkeyType_DisableHotkeys
  • QuickTaskMenuEditorForm_Separator
  • TaskSettings_CaptureAutoHideTaskbar
  • ...
Enter fullscreen mode Exit fullscreen mode

Found 5 keys that exist in .resx but aren't used in code!

Results

Language Before After Strings
Greek 0% 100% 170 new
Spanish 37% 100% 107 added

Total: 277 strings in ~5 minutes

Bonus: Team Collaboration with LRM Cloud

For team projects, sync to LRM Cloud (free tier available):

lrm cloud push
Enter fullscreen mode Exit fullscreen mode

LRM Cloud Dashboard

Features:

  • Web-based translation editor
  • Translation Memory & Glossary
  • GitHub integration
  • Role-based team access

Full Case Study

See the complete walkthrough with all CLI output:

ShareX Case Study on GitHub

Get Started

# Download LRM
curl -L https://github.com/nickprotop/LocalizationManager/releases/latest/download/lrm-linux-x64.tar.gz | tar xz

# Or on Windows
# Download from GitHub Releases

# Check your project
cd ./YourProject/Resources
lrm stats
Enter fullscreen mode Exit fullscreen mode

Links:

Have questions? Drop a comment or open a GitHub Discussion!

Top comments (0)