code: public static String getLocaleFromId(String entityId) {
  
          if (entityId.startsWith(ENTITY_ID_PREFIX)) {
              return entityId.substring(ENTITY_ID_PREFIX.length(), entityId.lastIndexOf("/"));
          }
          return null;
      }
docs: Extracts the locale from the entity id.<p>
  
  @param entityId the entity id
  
  @return the locale