The documentation for
The current user is not required to have access to a record type to see it in this map
So I was in the intention of that the method will run in system context.
However when the translation is enabled, I noticed this seems runs in user context as it's giving NPE for specific users.
Schema.SObjectType.myObj.getRecordTypeInfosByName().get('myRType') works perfect for other users while it's returning
null for users who have the record type translated. And confirmed it by having a debug point and verifying the map is having the translated record type.
Is there any confirmation on a documentation that this is the expected behavior? I believe there should be some centralized field to retrieve the master value.
P.S. It seems summer '18 preview is having
getRecordTypeInfosByDeveloperName() delivered. But still didn't have a chance to test with that.