Editing Language Localization

This guide explains how to modify and add translations for GOD - Crosshair Generator.

Localization File Location

The localization file is located at:

god-crosshair/ui/js/settings.js

The localization data is stored in the Locale object within this file.

Current Supported Languages

The script currently supports the following languages:

  • English (en)

  • Turkish (tr)

  • French (fr)

  • German (de)

  • Italian (it)

  • Spanish (es)

  • Arabic (ar)

  • Dutch (nl)

  • Portuguese (pt)

  • Danish (da)

  • Hungarian (hu)

  • Bulgarian (bg)

  • Czech (cs)

  • Finnish (fi)

  • Brazilian Portuguese (br)

  • Polish (pl)

  • Romanian (ro)

  • Slovak (sk)

  • Slovenian (sl)

Language Structure

Each language follows this structure:

Setting Labels

All available setting labels that need translation:

General Settings

  • generalSettingsTitle - "General" section title

  • toggleCrosshair - "Toggle Crosshair" label

  • firingError - "Firing Error" label

  • firingErrorMultiplier - "Firing Error Multiplier" label

Lines Settings

  • lineSettingsTitle - "Lines" section title

  • toggleLines - "Show Lines" label

  • lineColor - "Line Color" label

  • lineOpacity - "Line Opacity" label

  • lineLength - "Line Length" label

  • lineThickness - "Line Thickness" label

  • distanceBetweenLines - "Distance Between Lines" label

Outlines Settings

  • outlineSettingsTitle - "Outlines" section title

  • toggleOutlines - "Show Outlines" label

  • outlineColor - "Outline Color" label

  • outlineOpacity - "Outline Opacity" label

  • outlineThickness - "Outline Thickness" label

  • outlineBlur - "Outline Blur" label

Center Dot Settings

  • centerDotSettingsTitle - "Center Dot" section title

  • toggleCenterDot - "Show Center Dot" label

  • centerDotColor - "Center Dot Color" label

  • centerDotRoundness - "Center Dot Roundness" label

  • centerDotOpacity - "Center Dot Opacity" label

  • centerDotThickness - "Center Dot Thickness" label

  • toggleShotgun - "Shotgun Crosshair" label

Adding a New Language

Step 1: Add Language Entry

Add your new language to the Locale object in settings.js:

Step 2: Set Default Language (Optional)

To set your new language as the default, change:

Example: Adding Russian

Editing Existing Translations

To edit an existing translation:

  1. Open god-crosshair/ui/js/settings.js

  2. Find the language you want to edit (e.g., ["en"])

  3. Modify the translation strings

  4. Save the file

  5. Restart the resource: restart god-crosshair

Example: Changing English Translation

Language Codes

Use standard ISO 639-1 language codes:

  • en - English

  • tr - Turkish

  • fr - French

  • de - German

  • it - Italian

  • es - Spanish

  • ar - Arabic

  • nl - Dutch

  • pt - Portuguese

  • ru - Russian

  • ja - Japanese

  • zh - Chinese

  • etc.

Dynamic Language Switching

Currently, the language is set statically in the Locale.Lang variable. To implement dynamic language switching per player, you would need to modify the client-side code to:

  1. Store player language preference

  2. Send language preference from server to client

  3. Update Locale.Lang based on player preference

Testing Translations

After adding or modifying translations:

  1. Save the settings.js file

  2. Restart the resource: restart god-crosshair

  3. Join the server and open the crosshair menu (/crosshair)

  4. Verify all text appears correctly in your language

Common Issues

Translation Not Appearing

  • Check that the language code matches exactly

  • Verify all required labels are translated

  • Ensure the file was saved correctly

  • Restart the resource after changes

Missing Labels

If a label is missing, the UI will show the label key instead. Make sure all labels in the settingLabels object are translated.

Special Characters

Some languages use special characters. Make sure your file encoding is UTF-8 to display them correctly:

  • Arabic: العربية

  • Chinese: 中文

  • Russian: Русский

Best Practices

  1. Complete Translations: Always translate all labels, even if some seem obvious

  2. Consistent Terminology: Use consistent terms throughout (e.g., always use "Crosshair" not "Reticle")

  3. Context: Consider the context when translating (e.g., "Toggle" might need different translations in different contexts)

  4. Test: Always test translations in-game to ensure they fit the UI properly

  5. Backup: Keep a backup of the original file before making changes

File Structure Reference

The relevant section in settings.js:

Last updated