I am fetching the Labels & Values of a Picklist by using the following method
public static Map<String,String> getPickListValuesMap(string objName, string fieldName){
Schema.SObjectType objType = Schema.getGlobalDescribe().get(objName);
Map<String,String> valuesLabels=new Map<String,String>();
Map<String, Schema.SObjectField> fieldMap = objType.getDescribe().fields.getMap();
List<Schema.PicklistEntry> values = fieldMap.get(fieldName).getDescribe().getPicklistValues();
for(Schema.PicklistEntry ple : values){
valuesLabels.put(ple.getLabel(), ple.getValue());
}
return valuesLabels;
}
As we know getLabel() returns the Label of the picklist value based on user's language. Here my problem is, Schema.PicklistEntry not retuning any label for '--None--'(Neither in English nor in any other language). So i have added '--None--' to the list & displayed on the UI.
So Currently i am doing the translation for '--None--' by putting multiple if else statements in controller.js depending on the current User's language. As the languages are getting added this approach looks weird. So please suggest a better approach.