question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows: Change default English(US) Language (Properties->Details)

See original GitHub issue
  • Version: 5.26.0
  • Target: Windows

This is a follow up to #655

I’m working on a fix to enable Windows users to set the default language of the App.exe, Setup.exe etc. (currently set to English (US) for all exe’s).

atom/rcedit would be the ideal repo to take care of this, but I grew tired of waiting for a response from the maintainers. So here is my simple node script to modify the language / locale id :

'use strict';

const fs = require('fs'); 
                      // T r a n s l a t i o n  0x09 0x04    ( English (US) 16-bit word suffix )     
const keywordBuffer = [0x54, 0x00, 0x72, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x73, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x04]; 
const keywordLength = keywordBuffer.length;
var buffer;

try {
  var filename = './App.exe';  // hard-coded for simplicity  (script variable TODO)
  var fd = fs.openSync(filename, 'r+'); // read + write
  buffer = fs.readFileSync(fd);
  console.log(`Input File read: ${buffer.length} bytes`);

  var modified = false;
  for (var i = 0; i < buffer.length - keywordLength; i++) {
    if (keywordMatch(i)) {
      console.log('Language found at decimal address', i);
      buffer[i + 26] = 0x09;   // Language: English
      buffer[i + 27] = 0x0c;   // Sublanguage: Australia   see https://msdn.microsoft.com/en-au/goglobal/bb964664.aspx?f=255&MSPPError=-2147217396   for all valid hex locale ids 
      modified = true;
    }
  }
  if (modified) {
    fs.writeSync(fd, buffer, 0, buffer.length, 0);
    console.log('Language Updated!');
  } else {
    console.log('US language not found. File NOT modified!');
  } 
  fs.closeSync(fd);
} catch (err) {
  console.log(`There was an error: ${err}`);
}

function keywordMatch(index) {
  var i = 0;
  while (i < keywordLength) {
    if (keywordBuffer[i] === buffer[index]) {
      i++;
      index++;
    } else {
      return false;
    }
  }
  return true;
}

Notes:

  • I’ve hard-coded the filename above for simplicity. This should accept a variable.
  • This script is set to overwrite the file (can be easily modified not to)
  • The new language is hard-coded to English (Australia) for simplicity. (again, will be variable)
  • The Windows Locale ID’s can be found here (I’m using HEX, also note the ordering)
  • I’d imagine this could be expanded to an optional build.win.localeId = "0x0c09" where the user looks the locale id up manually ?
  • App.exe, Setup.exe (Squirrel), Setup.exe (NSIS) all display the new Language when you right-click->Properties->Details
  • App.exe and Setup.exe (Squirrel) both function as normal

Remaining Issues To Solve

  • NSIS performs some sort of CRC check at startup. Any modification after build, results in an error on setup file open. Any idea how to get around this ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
develarcommented, Aug 30, 2016

However, I think the issue should still remain open until rcedit sets language too.

Moved to backlog, marked as help-wanted and closed. I really want to finish work on #529 and currently no short-terms plans to fix it 😃

1reaction
dharderscommented, Aug 30, 2016

Ping @develar

Latest 6.3.0 release still erroring when legalTrademarks is set. See fix above.

(I would submit a PR but my dev env is windows, and currently broken)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the default input language for Windows
Set the default language for the Office programs to any language supported by your version of Windows.
Read more >
How to change system language on Windows 10
Change system language settings. To change the system default language, close your apps, and use these steps: Open Settings. Click on Time & ......
Read more >
Manage display language settings in Windows
The display language you select changes the default language used by Windows features, such as Settings and File Explorer. Select Start > Settings...
Read more >
How to Change your System Language completely in ...
Hi, So in short the steps are. 1. Add language pack in the control panel, go to Language & remove others. Set default...
Read more >
Change the default input language for Windows
Set the default language for the Office programs to any language supported by your version of Windows.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found