Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

[Bug] ToggleButton: unable to set property text="Normal"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Bug] ToggleButton: unable to set property text="Normal"

    There's something weird about assigning the text property of a ToggleButton to the word "Normal" or "normal"

    reproduction:

    <ToggleButton checked="true" text="Normal" />
    ToggleButton label shows up unexpectedly as "Base"

    <ToggleButton checked="true" text="normal" />
    ToggleButton label shows up unexpectedly as "Base"

    <ToggleButton checked="true" text="Normals" />
    ToggleButton label shows up as expected as "Normals"
    Training Map for Last Hitting Under a Tower:
    http://steamcommunity.com/sharedfile.../?id=531587903

  • #2
    Actually this bug applies for <Label> as well. can't set the text property to the word "normal"

    <Label text="Normal" /> also displays the word "Base"
    Last edited by Esteban; 10-17-2015, 09:56 PM.
    Training Map for Last Hitting Under a Tower:
    http://steamcommunity.com/sharedfile.../?id=531587903

    Comment


    • #3
      Thats because "normal" is defined as "Base" in DotA's localization files.
      Every time you have an issue, spend at least 5 minutes on each of these four sites Google, Wiki, Github, and ModDota
      If you still can't figure out your issue, post your issue on moddota in as much detail as possible with a SSCCE. If you do not complete these requirements, than you will be rejected by the community. Try not to contact individual users for help as we are very busy.

      Comment


      • #4
        Ok I see it in "dota 2 beta\game\dota\resource\dota_english.txt", but I'm not using a '#' for my text property. Wouldn't it need to be text="#Normal" for the string to be localized to "Base"?
        Training Map for Last Hitting Under a Tower:
        http://steamcommunity.com/sharedfile.../?id=531587903

        Comment


        • #5
          *Theoretically*, you should ALWAYS be localizing your strings, therefore the "#" in it is redundant.

          In practice, it makes more sense to require the # when localizing text. Not only does it make it more clear that you're looking for a localized string, but also localization is rarely ever used for testing purposes.

          However, volvo will run $.Localize on whenever you pass something to a text property. Thats volvo for you. It's more or less just a bunch of randomly stitched together subsystems working together to create one semi-working game.

          If you SERIOUSLY need to display "Normal" in a label, just localize a key that will translate to "Normal". (Putting "Normal " might also work, not sure.)
          Every time you have an issue, spend at least 5 minutes on each of these four sites Google, Wiki, Github, and ModDota
          If you still can't figure out your issue, post your issue on moddota in as much detail as possible with a SSCCE. If you do not complete these requirements, than you will be rejected by the community. Try not to contact individual users for help as we are very busy.

          Comment


          • #6
            I see. Adding a space to my string is actually what I ended up doing to work around this, works/looks fine.

            Weird thing is that I originally encountered this bug by setting the text property in javascript dynamically from a nettable, and today having read the localisation page, I see it explicitly says that text set through javascript is not automatically localized.

            https://developer.valvesoftware.com/...a/Localization
            If you dynamically set the text of a label from Javascript, it will NOT automatically localize the string. If you need to dynamically assign a localization token to a label, you need to localize the string in Javascript. (This technique has limited support for dialog variables.)
            Anyways, thanks for the help, at least I now know why it was doing this.
            Training Map for Last Hitting Under a Tower:
            http://steamcommunity.com/sharedfile.../?id=531587903

            Comment

            Working...
            X