
from pyhmsa.datafile import DataFile
from pyhmsa.type.language import langstr
datafile = DataFile()

author = langstr('Fyodor Dostoyevsky', {'ru': u'Фёдор Миха́йлович Достое́вский'})
datafile.header.author = author

print(datafile.header.author.alternatives['ru']) # Returns ...

from pyhmsa.datafile import DataFile
from pyhmsa.type.language import langstr
datafile = DataFile()

author = langstr('Wilhelm Conrad Roentgen', {'de': u'Wilhelm Conrad Röntgen'})
datafile.header.author = author

print(datafile.header.author.alternatives['de']) # Returns ...
Replace name in alternative language to prevent compilation problems with LaTeX
Replace name in alternative language to prevent compilation problems
with LaTeX
  
  from pyhmsa.datafile import DataFile
  from pyhmsa.type.language import langstr
  datafile = DataFile()
  
- author = langstr('Fyodor Dostoyevsky', {'ru': u'Фёдор Миха́йлович Достое́вский'})
+ author = langstr('Wilhelm Conrad Roentgen', {'de': u'Wilhelm Conrad Röntgen'})
  datafile.header.author = author
  
- print(datafile.header.author.alternatives['ru']) # Returns ...
+ print(datafile.header.author.alternatives['de']) # Returns ...
Replace name in alternative language to prevent compilation problems with LaTeX
## Code Before:

from pyhmsa.datafile import DataFile
from pyhmsa.type.language import langstr
datafile = DataFile()

author = langstr('Fyodor Dostoyevsky', {'ru': u'Фёдор Миха́йлович Достое́вский'})
datafile.header.author = author

print(datafile.header.author.alternatives['ru']) # Returns ...
## Instruction:
Replace name in alternative language to prevent compilation problems with LaTeX
## Code After:

from pyhmsa.datafile import DataFile
from pyhmsa.type.language import langstr
datafile = DataFile()

author = langstr('Wilhelm Conrad Roentgen', {'de': u'Wilhelm Conrad Röntgen'})
datafile.header.author = author

print(datafile.header.author.alternatives['de']) # Returns ...