Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessarily translated strings #3711

Merged
merged 7 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/net/rptools/maptool/language/I18N.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ public static String getString(String key) {
* @return the String found with mnemonics removed, or the input key if not found
*/
public static String getText(String key) {
if (key == null || key.isBlank()) {
// No benefit to doing a lookup
return key;
}

String value = getString(key);
if (value == null) {
log.debug("Cannot find key '" + key + "' in properties file.");
Expand Down
22 changes: 15 additions & 7 deletions src/main/java/net/rptools/maptool/model/Asset.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.protobuf.ByteString;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import java.awt.image.BufferedImage;
Expand Down Expand Up @@ -791,22 +792,29 @@ private boolean isBroken() {
}

public static Asset fromDto(AssetDto dto) {
var dtoData = dto.getData().toByteArray();
var asset =
new Asset(
new MD5Key(dto.getMd5Key()),
dto.getName(),
dtoData,
dto.getExtension(),
Asset.Type.valueOf(dto.getType().name()),
false);
dtoData.length == 0);
return asset;
}

public AssetDto toDto() {
return AssetDto.newBuilder()
.setMd5Key(getMD5Key().toString())
.setName(getName())
.setExtension(getExtension())
.setType(AssetDtoType.valueOf(getType().name()))
.build();
var builder =
AssetDto.newBuilder()
.setMd5Key(getMD5Key().toString())
.setName(getName())
.setExtension(getExtension())
.setType(AssetDtoType.valueOf(getType().name()));

if (getData() != null) {
builder.setData(ByteString.copyFrom(data));
}
return builder.build();
}
}
1 change: 1 addition & 0 deletions src/main/proto/data_transfer_objects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ message AssetDto {
string name = 2;
string extension = 3;
AssetDtoType type = 4;
bytes data = 5;
}

message LabelDto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@
</at>
<at name="name">propertiesTable</at>
<at name="width">1161</at>
<at name="text">EditTokenDialog.table.properties</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down Expand Up @@ -3514,7 +3514,7 @@
</at>
<at name="name">ownershipList</at>
<at name="width">1161</at>
<at name="text">EditTokenDialog.label.Ownership</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down Expand Up @@ -7087,7 +7087,7 @@
</at>
<at name="name">xmlStatblockRTextScrollPane</at>
<at name="width">1110</at>
<at name="text">EditTokenDialog.label.hero.statBlockRTextScroll.xml</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down Expand Up @@ -7445,7 +7445,7 @@
</at>
<at name="name">textStatblockRTextScrollPane</at>
<at name="width">1110</at>
<at name="text">EditTokenDialog.label.hero.statBlockRTextScroll.text</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down Expand Up @@ -8070,7 +8070,7 @@
</at>
<at name="name">summaryText</at>
<at name="width">850</at>
<at name="text">EditTokenDialog.valueNotSet.hero.summary</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down Expand Up @@ -8131,7 +8131,7 @@
<at name="autoscrolls">true</at>
<at name="name">portfolioLocation</at>
<at name="width">95</at>
<at name="text">EditTokenDialog.valueNotSet.hero.portfolio</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down Expand Up @@ -8251,7 +8251,7 @@
</at>
<at name="name">lastModified</at>
<at name="width">70</at>
<at name="text">EditTokenDialog.valueNotSet.hero.last</at>
<at name="text"></at>
<at name="fill">
<object classname="com.jeta.forms.store.properties.effects.PaintProperty">
<at name="name">fill</at>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ EditTokenDialog.border.title.handout = Handout
EditTokenDialog.border.title.charsheet = Charsheet
EditTokenDialog.status.layout.instructions = Mouse Wheel to zoom; double-LClick to reset position and zoom
EditTokenDialog.label.allplayers = All Players
EditTokenDialog.label.Ownership = ownerShipLabel
EditTokenDialog.tab.properties = Properties
EditTokenDialog.tab.vbl = Topology
EditTokenDialog.tab.state = State
Expand All @@ -296,7 +295,6 @@ EditTokenDialog.tab.ownership = Ownership
EditTokenDialog.tab.config = Config
EditTokenDialog.tab.hero = Hero Lab
EditTokenDialog.tab.libToken = Lib:Token properties
EditTokenDialog.table.properties = propertiesTable
EditTokenDialog.button.vbl = Generate Token Topology
EditTokenDialog.button.vbl.tooltip = This will create VBL/MBL based on non-transparent pixels.
EditTokenDialog.button.vbl.clear = Clear Token Topology
Expand Down Expand Up @@ -328,18 +326,13 @@ EditTokenDialog.status.vbl.instructions = Mouse Wheel to zoom; double-LClick to
EditTokenDialog.label.hero.summary = Summary:
EditTokenDialog.label.hero.portfolio = Portfolio:
EditTokenDialog.label.hero.last = Last Modified:
EditTokenDialog.valueNotSet.hero.summary = summaryText
EditTokenDialog.valueNotSet.hero.portfolio = portfolioLocation
EditTokenDialog.valueNotSet.hero.last = lastModified
EditTokenDialog.button.hero.setAsTokenPortrait = Set as Token Portrait
EditTokenDialog.button.hero.setAsTokenImage = Set as Token Image
EditTokenDialog.button.hero.setAsTokenHandout = Set as Token Handout
EditTokenDialog.label.hero.isAlly = Ally?
EditTokenDialog.label.hero.statBlockSearch = Expression:
EditTokenDialog.button.hero.statBlockSearch.tooltip = Search the statblock using the expression provided.
EditTokenDialog.label.hero.statBlockSearch.tooltip = Enter raw text, a regular expression or an xPath expression to search the statblock for.
EditTokenDialog.label.hero.statBlockRTextScroll.text = textStatblockRTextScrollPane
EditTokenDialog.label.hero.statBlockRTextScroll.xml = xmlStatblockRTextScrollPane
EditTokenDialog.action.hero.statBlockRTextScroll = Find
EditTokenDialog.tab.hero.images = Images
EditTokenDialog.tab.hero.text = TEXT
Expand Down