ó
Ä\c           @` sc   d  d l  m Z m Z m Z d  d l Z d  d l Z e e d  Z d   Z e j	 j
 d e  d S(   i    (   t   absolute_importt   divisiont   print_functionNc   	   
   C` sų   | r2 |  t  j j j j k r2 t d |    n  t  j j j j |  } i  } | r t | d    } | j t j	 | d   Wd  QXn  x< | j
 j   D]+ \ } } | r | | k r | | | <q q Wt | d   } t j | | d t Wd  QXd  S(   Ns+   Language %r does not have any translations.t   rs   utf-8t   wbt   ensure_ascii(   t   renpyt   gamet   scriptt
   translatort   stringst	   Exceptiont   opent   updatet   jsont   loadt   translationst	   iteritemst   dumpt   True(	   t   languaget   destinationt   merget   forcet   stt   resultt   ft   kt   v(    (    sr   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\translation\extract.pyt   extract_strings_core   s    "c          C` s·   t  j j d d  }  |  j d d d |  j d d d |  j d d d	 d
 d |  j d d d d
 d |  j   } | j } | d k r d } n  t | | j | j	 | j
  t S(   s&   
    The extract strings command.
    t   descriptions   Extracts translated strings.R   t   helps0   The language to extract translated strings from.R   s3   The json file to store the translated strings into.s   --mergesd   If given, the current contents of the file are preserved, and new contents are merged into the file.t   actiont
   store_trues   --forces8   If given, noting happens if the language does not exist.t   NoneN(   R   t	   argumentst   ArgumentParsert   add_argumentt
   parse_argsR   R"   R   R   R   R   t   False(   t   apt   argsR   (    (    sr   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\translation\extract.pyt   extract_strings1   s    		R*   (   t
   __future__R    R   R   R   R   R'   R   R*   R#   t   register_command(    (    (    sr   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\translation\extract.pyt   <module>   s
   	