~noskcaj/ubuntu/vivid/gtksourceview3/3.14.3

« back to all changes in this revision

Viewing changes to gtksourceview/gtksourceencoding.c

  • Committer: Jackson Doak
  • Date: 2015-02-25 07:35:55 UTC
  • mfrom: (1.4.8)
  • Revision ID: noskcaj@ubuntu.com-20150225073555-vooke1hcu439l4py
New upstream release. LP: #1423016

Show diffs side-by-side

added added

removed removed

Lines of Context:
627
627
_gtk_source_encoding_get_default_candidates (void)
628
628
{
629
629
        const gchar *encodings_str;
 
630
        const gchar *encodings_str_translated;
630
631
        GVariant *encodings_variant;
631
632
        const gchar **encodings_strv;
632
633
        GSList *encodings_list;
 
634
        GError *error = NULL;
633
635
 
634
636
        /* Translators: This is the sorted list of encodings used by
635
637
         * GtkSourceView for automatic detection of the file encoding. You may
643
645
         * recognized encodings are used. See
644
646
         * https://git.gnome.org/browse/gtksourceview/tree/gtksourceview/gtksourceencoding.c#n147
645
647
         * for a list of supported encodings.
 
648
         * Keep the same format: square brackets, single quotes, commas.
646
649
         */
647
 
        encodings_str = _("['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']");
648
 
 
649
 
        encodings_variant = g_variant_new_parsed (encodings_str);
 
650
        encodings_str = N_("['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']");
 
651
 
 
652
        encodings_str_translated = _(encodings_str);
 
653
 
 
654
        encodings_variant = g_variant_parse (G_VARIANT_TYPE_STRING_ARRAY,
 
655
                                             encodings_str_translated,
 
656
                                             NULL,
 
657
                                             NULL,
 
658
                                             &error);
 
659
 
 
660
        if (error != NULL)
 
661
        {
 
662
                const gchar * const *language_names = g_get_language_names ();
 
663
 
 
664
                g_warning ("Error while parsing encodings list for locale %s:\n"
 
665
                           "Translated list: %s\n"
 
666
                           "Error message: %s",
 
667
                           language_names[0],
 
668
                           encodings_str_translated,
 
669
                           error->message);
 
670
 
 
671
                g_error_free (error);
 
672
                error = NULL;
 
673
 
 
674
                encodings_variant = g_variant_parse (G_VARIANT_TYPE_STRING_ARRAY,
 
675
                                                     encodings_str,
 
676
                                                     NULL,
 
677
                                                     NULL,
 
678
                                                     &error);
 
679
 
 
680
                g_assert_no_error (error);
 
681
        }
 
682
 
650
683
        g_variant_ref_sink (encodings_variant);
651
684
 
652
685
        encodings_strv = g_variant_get_strv (encodings_variant, NULL);