Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6590431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:17:53+00:00 2026-05-25T17:17:53+00:00

I am relatively new to Delphi so please bear with me. Basically, I need

  • 0

I am relatively new to Delphi so please bear with me. Basically, I need to set variables as different values based on whether or not I am testing in an English or French translated environment. All menus in these TC scripts are accessed by their names and in French they are not the same. I can, however, access them by their position in the menu – such as [4|2].

I have a list of constants and would like to set up an array to set MenuItem1 to either File|New or [4|2] depending on the value of tcDecimalSeparator <> '.' (set as a declared constant).

Does this make sense? What would be the easiest / best way to do this?

I know I could probably set this all up with data driven testing but I don’t want to rework the scripts that much prior to release.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:17:54+00:00Added an answer on May 25, 2026 at 5:17 pm

    No, your proposed solution does not make sense. First, switching based on the current decimal separator is unreliable. Second, if you already know the positions of the menu items, and they always work, regardless of the program’s language, then why mess around with the English menu captions at all? Just use the menu positions all the time. (Or, if you already have something set up to select the menu text based on the language, why not also use the French menu text instead of switching between English text and French positions?)

    To do what you propose, you can set up a two-dimensional array of menu identifiers:

    const
      TLanguage = (lEnglish, lFrench);
      TUIElement = (uiFileNew, uiFileOpen, ...);
    
      MenuIDs = array[TUIElement] of array[TLanguage] of string = (
        ('File|New', '[4|2]'),
        ('File|Open', '[4|3]')
      );
    

    Then, when you want a string, select the item that corresponds to your UI element, and then select the string for the current language:

    if tcDecimalSeparator = '.' then
      CurrentLang := lEnglish
    else
      CurrentLang := lFrench;
    
    UseMenuItem(MenuIDs[uiFileNew, CurrentLang]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am relatively new to Android. My experience in testing isn't too deep either.
I'm relatively new to Windows Phone 7 development, so bear with me on this.
Being relatively new to javascript, AJAX and jQuery, I want to post 3 values
I am relatively new to Android programming. So please, forgive me for writing or
Relatively new to rails and trying to model a very simple family tree with
Being relatively new to the .net game, I was wondering, has anyone had any
Being relatively new to functional programming, I expend lots of energy wondering is this
Caveat: I'm relatively new to coding as well as TextMate , so apologies if
I'm relatively new to J2ME and about to begin my first serious project. My
I am relatively new to web services and am wondering what the standard best

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.