package valandur.webapi.cache.misc;

import org.spongepowered.api.CatalogType;
import valandur.webapi.api.cache.CachedObject;

public class CachedCatalogType extends CachedObject<CatalogType> {

    private String id;
    public String getId() {
        return id;
    }

    private String name;
    public String getName() {
        return name;
    }


    public CachedCatalogType(CatalogType catalogType) {
        super(catalogType, false);

        this.id = catalogType.getId();
        this.name = catalogType.getName();
    }
}

@@ -72,16 +72,76 @@
 ogType;%0A
+import org.spongepowered.api.text.translation.Translatable;%0A
 import v
@@ -536,24 +536,172 @@
 pe.getId();%0A
+        if (catalogType instanceof Translatable) %7B%0A            this.name = ((Translatable)catalogType).getTranslation().get();%0A        %7D else %7B%0A    
         this
@@ -727,20 +727,30 @@
 .getName();%0A
+        %7D%0A
     %7D%0A%7D%0A

Return translated name for catalog types when possible