@@ -32,7 +32,8 @@ define(function (require, exports, module) {
3232 throw new Error ( "manage-licenses should have access to KernalModeTrust. Cannot boot without trust ring" ) ;
3333 }
3434
35- const Dialogs = require ( "widgets/Dialogs" ) ,
35+ const Strings = require ( "strings" ) ,
36+ Dialogs = require ( "widgets/Dialogs" ) ,
3637 Mustache = require ( "thirdparty/mustache/mustache" ) ,
3738 licenseManagementHTML = require ( "text!./html/license-management.html" ) ;
3839
@@ -105,7 +106,7 @@ define(function (require, exports, module) {
105106 const response = await fetchFn ( apiURL , {
106107 method : 'POST' ,
107108 headers : {
108- 'Content-Type' : 'application/json' ,
109+ 'Content-Type' : 'application/json'
109110 } ,
110111 body : JSON . stringify ( {
111112 licenseKey : licenseKey ,
@@ -133,10 +134,10 @@ define(function (require, exports, module) {
133134 */
134135 function _formatDate ( timestamp ) {
135136 if ( ! timestamp ) {
136- return 'Never' ;
137+ return Strings . LICENSE_VALID_NEVER ;
137138 }
138139 const date = new Date ( timestamp ) ;
139- return date . toLocaleDateString ( 'en-US' , {
140+ return date . toLocaleDateString ( Phoenix . getLocale ( ) , {
140141 year : 'numeric' ,
141142 month : 'long' ,
142143 day : 'numeric'
@@ -160,16 +161,16 @@ define(function (require, exports, module) {
160161
161162 if ( licenseData && licenseData . isValid ) {
162163 // Show valid license info
163- $dialog . find ( '#licensed-to-name' ) . text ( licenseData . licensedToName || 'Unknown' ) ;
164- $dialog . find ( '#license-type-name' ) . text ( licenseData . licenseTypeName || 'Unknown' ) ;
164+ $dialog . find ( '#licensed-to-name' ) . text ( licenseData . licensedToName || Strings . LICENSE_STATUS_UNKNOWN ) ;
165+ $dialog . find ( '#license-type-name' ) . text ( licenseData . licenseTypeName || Strings . LICENSE_STATUS_UNKNOWN ) ;
165166 $dialog . find ( '#license-valid-till' ) . text ( _formatDate ( licenseData . validTill ) ) ;
166167 $valid . show ( ) ;
167168 } else if ( licenseData && licenseData . isValid === false ) {
168169 // No valid license
169170 $none . show ( ) ;
170171 } else {
171172 // Error state
172- $dialog . find ( '#license-error-message' ) . text ( 'Error checking license status' ) ;
173+ $dialog . find ( '#license-error-message' ) . text ( Strings . LICENSE_STATUS_ERROR_CHECK ) ;
173174 $error . show ( ) ;
174175 }
175176 }
@@ -245,18 +246,18 @@ define(function (require, exports, module) {
245246 const result = await _registerDevice ( licenseKey , deviceID , platform , deviceLabel ) ;
246247
247248 if ( result . isSuccess ) {
248- _showActivationMessage ( $dialog , true , result . message || 'License activated successfully!' ) ;
249+ _showActivationMessage ( $dialog , true , result . message || Strings . LICENSE_ACTIVATE_SUCCESS ) ;
249250
250251 // Clear the input field
251252 $dialog . find ( '#license-key-input' ) . val ( '' ) ;
252253
253254 // Refresh license status
254255 await _loadLicenseStatus ( $dialog ) ;
255256 } else {
256- _showActivationMessage ( $dialog , false , result . errorMessage || 'Failed to activate license' ) ;
257+ _showActivationMessage ( $dialog , false , result . errorMessage || Strings . LICENSE_ACTIVATE_FAIL ) ;
257258 }
258259 } catch ( error ) {
259- _showActivationMessage ( $dialog , false , error . message || 'Failed to activate license' ) ;
260+ _showActivationMessage ( $dialog , false , error . message || Strings . LICENSE_ACTIVATE_FAIL ) ;
260261 } finally {
261262 // Reset button state
262263 $btn . prop ( 'disabled' , false ) ;
@@ -266,7 +267,7 @@ define(function (require, exports, module) {
266267 }
267268
268269 async function showManageLicensesDialog ( ) {
269- const $template = $ ( Mustache . render ( licenseManagementHTML , { } ) ) ;
270+ const $template = $ ( Mustache . render ( licenseManagementHTML , { Strings } ) ) ;
270271
271272 Dialogs . showModalDialogUsingTemplate ( $template ) ;
272273
@@ -279,7 +280,7 @@ define(function (require, exports, module) {
279280 $activateBtn . on ( 'click' , async function ( ) {
280281 const licenseKey = $licenseInput . val ( ) . trim ( ) ;
281282 if ( ! licenseKey ) {
282- _showActivationMessage ( $dialog , false , 'Please enter a license key' ) ;
283+ _showActivationMessage ( $dialog , false , Strings . LICENSE_ENTER_KEY ) ;
283284 return ;
284285 }
285286
0 commit comments