1ForeverHD / TopbarPlus

Construct dynamic and intuitive topbar icons. Enhance the appearance and behaviour of these icons with features such as themes, dropdowns and menus.
https://devforum.roblox.com/t/topbarplus/1017485
Mozilla Public License 2.0
95 stars 123 forks source link

localised text not displaying properly #38

Closed RooflOmg closed 1 year ago

RooflOmg commented 2 years ago

When the game is using localised text image its not gonna display properly, when theres more width than the source one. heres the preview of what will happen image

1ForeverHD commented 2 years ago

Good idea, can you add the following code to your Icon module at line 755:

-- Localization support
instances.iconLabel:GetPropertyChangedSignal("Text"):Connect(function()
    local labelText = instances.iconLabel.Text
    local iconState = self:getIconState()
    local settingsText = self:get("iconText", iconState)
    if labelText ~= settingsText then
        self:setLabel(labelText)
    end
end)

image

If this works without causing any issues, can you then confirm please and I'll officially deploy an update for this. Thanks!

RooflOmg commented 2 years ago

Good idea, can you add the following code to your Icon module at line 755:

-- Localization support
instances.iconLabel:GetPropertyChangedSignal("Text"):Connect(function()
  local labelText = instances.iconLabel.Text
  local iconState = self:getIconState()
  local settingsText = self:get("iconText", iconState)
  if labelText ~= settingsText then
      self:setLabel(labelText)
  end
end)

image

If this works without causing any issues, can you then confirm please and I'll officially deploy an update for this. Thanks!

image still doesnt work (i removed the notify from the code tho)

1ForeverHD commented 2 years ago

Okay thanks for the report, it appears the labels aren't detecting as changed with localized text (therefore not expanding). I will provide a fix for this and complete support for localization in the next update (although I can't guarantee when as Nanoblox is currently our top priority).

1ForeverHD commented 1 year ago

Resolved in v.2.8.0!